diff --git a/GITHUB_CHANGELOG.md b/GITHUB_CHANGELOG.md index 0aa3006acb..bbae2df30d 100644 --- a/GITHUB_CHANGELOG.md +++ b/GITHUB_CHANGELOG.md @@ -43,6 +43,7 @@ Compatibility list: * Icon not responding to mouse cursor * Rare NoSuchMethodError crash on IMS canImeRenderGesturalNavButtons * [Lawnchair] Reimplement Bulk icons toggle +* SettingsCache crashing with SecurityException with unreadable keys (@hide) in Android 12 and newer (assume false) #### Known Bugs * Preview can't show device wallpaper -> (lIxkAYGg) diff --git a/src/com/android/launcher3/util/SettingsCache.java b/src/com/android/launcher3/util/SettingsCache.java index fa183c8d6a..a4577ecc26 100644 --- a/src/com/android/launcher3/util/SettingsCache.java +++ b/src/com/android/launcher3/util/SettingsCache.java @@ -28,6 +28,7 @@ import android.os.Handler; import android.os.Looper; import android.provider.Settings; +import android.util.Log; import androidx.annotation.UiThread; import com.android.launcher3.dagger.ApplicationContext; @@ -137,7 +138,12 @@ public class SettingsCache extends ContentObserver { if (mKeyCache.containsKey(keySetting)) { return mKeyCache.get(keySetting); } else { - return updateValue(keySetting, defaultValue); + try { + return updateValue(keySetting, defaultValue); + } catch (SecurityException e) { + Log.d("LC_SettingsCache", "Key not readable, assume false for " + keySetting.toString()); + return false; + } } }