Initiate taskbar only after the user is unlocked

Bug: 188755902
Test: Presubmit
Change-Id: Ida4bc07f45396e82ab404a617aa6833afeea78bc
This commit is contained in:
Sunny Goyal
2021-05-20 13:45:58 -07:00
parent f8b1c3b38e
commit 301eaf2b8c
2 changed files with 14 additions and 0 deletions

View File

@@ -57,6 +57,8 @@ public class TaskbarManager implements DisplayController.DisplayInfoChangeListen
private static final int CHANGE_FLAGS =
CHANGE_ACTIVE_SCREEN | CHANGE_DENSITY | CHANGE_SUPPORTED_BOUNDS;
private boolean mUserUnlocked = false;
public TaskbarManager(TouchInteractionService service) {
mDisplayController = DisplayController.INSTANCE.get(service);
mSysUINavigationMode = SysUINavigationMode.INSTANCE.get(service);
@@ -89,6 +91,14 @@ public class TaskbarManager implements DisplayController.DisplayInfoChangeListen
}
}
/**
* Called when the user is unlocked
*/
public void onUserUnlocked() {
mUserUnlocked = true;
recreateTaskbar();
}
/**
* Sets or clears a launcher to act as taskbar callback
*/
@@ -106,6 +116,9 @@ public class TaskbarManager implements DisplayController.DisplayInfoChangeListen
if (!FeatureFlags.ENABLE_TASKBAR.get()) {
return;
}
if (!mUserUnlocked) {
return;
}
DeviceProfile dp = LauncherAppState.getIDP(mContext).getDeviceProfile(mContext);
if (!dp.isTaskbarPresent) {
return;