Create taskbar for kids mode.

Test: manual
Bug: 203749295
Change-Id: I52c05cf8685e6e921bb717e9714d1cb2e5f4a351
This commit is contained in:
Pat Manning
2021-11-22 14:29:52 +00:00
parent 3b7ae6e723
commit 2c4a1d8f7a
6 changed files with 112 additions and 8 deletions

View File

@@ -112,6 +112,7 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
private final boolean mIsSafeModeEnabled;
private final boolean mIsUserSetupComplete;
private final boolean mIsNavBarKidsMode;
private boolean mIsDestroyed = false;
// The flag to know if the window is excluded from magnification region computation.
private boolean mIsExcludeFromMagnificationRegion = false;
@@ -129,6 +130,8 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
() -> getPackageManager().isSafeMode());
mIsUserSetupComplete = SettingsCache.INSTANCE.get(this).getValue(
Settings.Secure.getUriFor(Settings.Secure.USER_SETUP_COMPLETE), 0);
mIsNavBarKidsMode = SettingsCache.INSTANCE.get(this).getValue(
Settings.Secure.getUriFor(Settings.Secure.NAV_BAR_KIDS_MODE), 0);
final Resources resources = getResources();
float taskbarIconSize = resources.getDimension(R.dimen.taskbar_icon_size);
@@ -385,7 +388,8 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
| SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
onNotificationShadeExpandChanged((systemUiStateFlags & shadeExpandedFlags) != 0, fromInit);
mControllers.taskbarViewController.setRecentsButtonDisabled(
mControllers.navbarButtonsViewController.isRecentsDisabled());
mControllers.navbarButtonsViewController.isRecentsDisabled()
|| isNavBarKidsModeActive());
mControllers.stashedHandleViewController.setIsHomeButtonDisabled(
mControllers.navbarButtonsViewController.isHomeDisabled());
mControllers.taskbarKeyguardController.updateStateForSysuiFlags(systemUiStateFlags);
@@ -587,6 +591,10 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
return mIsUserSetupComplete;
}
protected boolean isNavBarKidsModeActive() {
return mIsNavBarKidsMode && isThreeButtonNav();
}
/**
* Called when we determine the touchable region.
*