Fix Settting Cache NPE
Test: Presubmit Bug: 406906811 Flag: EXEMPT bugfix Change-Id: If2dacf2686339a0c8b9e87fdd9a8e555a813aab1
This commit is contained in:
1 parent
a96d9ce82c
commit
bcd634a31f
2 files changed
+20
-12
No files matched your search
@@ -236,9 +236,9 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
private boolean mImeDrawsImeNavBar;
|
||||
|
||||
private final boolean mIsSafeModeEnabled;
|
||||
private final boolean mIsUserSetupComplete;
|
||||
private final boolean mIsNavBarForceVisible;
|
||||
private final boolean mIsNavBarKidsMode;
|
||||
private boolean mIsUserSetupComplete;
|
||||
private boolean mIsNavBarForceVisible;
|
||||
private boolean mIsNavBarKidsMode;
|
||||
|
||||
private boolean mIsDestroyed = false;
|
||||
private boolean mAddedWindow = false;
|
||||
@@ -284,15 +284,6 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
mIsSafeModeEnabled = TraceHelper.allowIpcs("isSafeMode",
|
||||
() -> getPackageManager().isSafeMode());
|
||||
|
||||
// TODO(b/244231596) For shared Taskbar window, update this value in applyDeviceProfile()
|
||||
// instead so to get correct value when recreating the taskbar
|
||||
SettingsCache settingsCache = SettingsCache.INSTANCE.get(this);
|
||||
mIsUserSetupComplete = settingsCache.getValue(
|
||||
Settings.Secure.getUriFor(Settings.Secure.USER_SETUP_COMPLETE), 0);
|
||||
mIsNavBarKidsMode = settingsCache.getValue(
|
||||
Settings.Secure.getUriFor(Settings.Secure.NAV_BAR_KIDS_MODE), 0);
|
||||
mIsNavBarForceVisible = mIsNavBarKidsMode;
|
||||
|
||||
// Get display and corners first, as views might use them in constructor.
|
||||
Context c = getApplicationContext();
|
||||
mWindowManager = c.getSystemService(WindowManager.class);
|
||||
@@ -502,6 +493,13 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
.build();
|
||||
}
|
||||
mNavMode = getNavigationMode();
|
||||
|
||||
SettingsCache settingsCache = SettingsCache.INSTANCE.get(this);
|
||||
mIsUserSetupComplete = settingsCache.getValue(
|
||||
Settings.Secure.getUriFor(Settings.Secure.USER_SETUP_COMPLETE), 0);
|
||||
mIsNavBarKidsMode = settingsCache.getValue(
|
||||
Settings.Secure.getUriFor(Settings.Secure.NAV_BAR_KIDS_MODE), 0);
|
||||
mIsNavBarForceVisible = mIsNavBarKidsMode;
|
||||
}
|
||||
|
||||
/** Called when the visibility of the bubble bar changed. */
|
||||
|
||||
Reference in new issue
Block a user