[CD Taskbar] Bypass binder calls for TaskbarManager#getDefaultDisplayId()
Calls to TaskbarManager#getDefaultDisplay() were making binder calls each time, which caused a crash in cases where binder is blocked. Now, I cache the default displayId avoid these calls. Flag: EXEMPT not adding new behavior Bug: 400606685 Test: m Change-Id: I4a0c0d0c99efb137119b2299d3259541379a6bb6
This commit is contained in:
1 parent
59a89b2655
commit
602874bb51
2 files changed
+9
-7
No files matched your search
@@ -138,6 +138,7 @@ public class TaskbarManager {
|
||||
Settings.Secure.NAV_BAR_KIDS_MODE);
|
||||
|
||||
private final Context mBaseContext;
|
||||
private final int mPrimaryDisplayId;
|
||||
private final TaskbarNavButtonCallbacks mNavCallbacks;
|
||||
// TODO: Remove this during the connected displays lifecycle refactor.
|
||||
private final Context mPrimaryWindowContext;
|
||||
@@ -434,21 +435,21 @@ public class TaskbarManager {
|
||||
TaskbarNavButtonCallbacks navCallbacks,
|
||||
RecentsDisplayModel recentsDisplayModel) {
|
||||
mBaseContext = context;
|
||||
mPrimaryDisplayId = mBaseContext.getDisplayId();
|
||||
mAllAppsActionManager = allAppsActionManager;
|
||||
mNavCallbacks = navCallbacks;
|
||||
mRecentsDisplayModel = recentsDisplayModel;
|
||||
|
||||
// Set up primary display.
|
||||
int primaryDisplayId = getDefaultDisplayId();
|
||||
debugPrimaryTaskbar("TaskbarManager constructor");
|
||||
mPrimaryWindowContext = createWindowContext(primaryDisplayId);
|
||||
mPrimaryWindowContext = createWindowContext(getDefaultDisplayId());
|
||||
mPrimaryWindowManager = mPrimaryWindowContext.getSystemService(WindowManager.class);
|
||||
DesktopVisibilityController.INSTANCE.get(
|
||||
mPrimaryWindowContext).registerTaskbarDesktopModeListener(
|
||||
mTaskbarDesktopModeListener);
|
||||
createTaskbarRootLayout(primaryDisplayId);
|
||||
createNavButtonController(primaryDisplayId);
|
||||
createAndRegisterComponentCallbacks(primaryDisplayId);
|
||||
createTaskbarRootLayout(getDefaultDisplayId());
|
||||
createNavButtonController(getDefaultDisplayId());
|
||||
createAndRegisterComponentCallbacks(getDefaultDisplayId());
|
||||
|
||||
SettingsCache.INSTANCE.get(mPrimaryWindowContext)
|
||||
.register(USER_SETUP_COMPLETE_URI, mOnSettingsChangeListener);
|
||||
@@ -1667,7 +1668,7 @@ public class TaskbarManager {
|
||||
}
|
||||
|
||||
private int getDefaultDisplayId() {
|
||||
return mBaseContext.getDisplayId();
|
||||
return mPrimaryDisplayId;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user