[Work Profile] Fix NPE on WorkModeSwitch
Bug: 202868251 Test: manual Change-Id: I16e149e0aab1b53f7a0e753f353ccace08cf6b71
This commit is contained in:
@@ -485,8 +485,9 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
|
||||
mViewPager = (AllAppsPagedView) newView;
|
||||
mViewPager.initParentViews(this);
|
||||
mViewPager.getPageIndicator().setOnActivePageChangedListener(this);
|
||||
mWorkManager.attachWorkModeSwitch();
|
||||
mWorkManager.getWorkModeSwitch().post(() -> mAH[AdapterHolder.WORK].applyPadding());
|
||||
if (mWorkManager.attachWorkModeSwitch()) {
|
||||
mWorkManager.getWorkModeSwitch().post(() -> mAH[AdapterHolder.WORK].applyPadding());
|
||||
}
|
||||
} else {
|
||||
mWorkManager.detachWorkModeSwitch();
|
||||
mViewPager = null;
|
||||
|
||||
Reference in New Issue
Block a user