Merge "Add workaround to handle overlay package changes for non-primary users" into qt-dev
am: a35495ffa3
Change-Id: I336c9600a453e8f745c1bd1f0a1f2527379e1260
This commit is contained in:
@@ -156,10 +156,7 @@ public class FragmentHostManager {
|
|||||||
*/
|
*/
|
||||||
protected void onConfigurationChanged(Configuration newConfig) {
|
protected void onConfigurationChanged(Configuration newConfig) {
|
||||||
if (mConfigChanges.applyNewConfig(mContext.getResources())) {
|
if (mConfigChanges.applyNewConfig(mContext.getResources())) {
|
||||||
// Save the old state.
|
reloadFragments();
|
||||||
Parcelable p = destroyFragmentHost();
|
|
||||||
// Generate a new fragment host and restore its state.
|
|
||||||
createFragmentHost(p);
|
|
||||||
} else {
|
} else {
|
||||||
mFragments.dispatchConfigurationChanged(newConfig);
|
mFragments.dispatchConfigurationChanged(newConfig);
|
||||||
}
|
}
|
||||||
@@ -217,6 +214,13 @@ public class FragmentHostManager {
|
|||||||
Dependency.get(FragmentService.class).removeAndDestroy(view);
|
Dependency.get(FragmentService.class).removeAndDestroy(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void reloadFragments() {
|
||||||
|
// Save the old state.
|
||||||
|
Parcelable p = destroyFragmentHost();
|
||||||
|
// Generate a new fragment host and restore its state.
|
||||||
|
createFragmentHost(p);
|
||||||
|
}
|
||||||
|
|
||||||
class HostCallbacks extends FragmentHostCallback<FragmentHostManager> {
|
class HostCallbacks extends FragmentHostCallback<FragmentHostManager> {
|
||||||
public HostCallbacks() {
|
public HostCallbacks() {
|
||||||
super(mContext, FragmentHostManager.this.mHandler, 0);
|
super(mContext, FragmentHostManager.this.mHandler, 0);
|
||||||
@@ -293,13 +297,6 @@ public class FragmentHostManager {
|
|||||||
reloadFragments();
|
reloadFragments();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reloadFragments() {
|
|
||||||
// Save the old state.
|
|
||||||
Parcelable p = destroyFragmentHost();
|
|
||||||
// Generate a new fragment host and restore its state.
|
|
||||||
createFragmentHost(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
Fragment instantiate(Context context, String className, Bundle arguments) {
|
Fragment instantiate(Context context, String className, Bundle arguments) {
|
||||||
Context extensionContext = mExtensionLookup.get(className);
|
Context extensionContext = mExtensionLookup.get(className);
|
||||||
if (extensionContext != null) {
|
if (extensionContext != null) {
|
||||||
|
|||||||
@@ -979,6 +979,17 @@ public class NavigationBarFragment extends LifecycleFragment implements Callback
|
|||||||
public void onNavigationModeChanged(int mode) {
|
public void onNavigationModeChanged(int mode) {
|
||||||
mNavBarMode = mode;
|
mNavBarMode = mode;
|
||||||
updateScreenPinningGestures();
|
updateScreenPinningGestures();
|
||||||
|
|
||||||
|
// Workaround for b/132825155, for secondary users, we currently don't receive configuration
|
||||||
|
// changes on overlay package change since SystemUI runs for the system user. In this case,
|
||||||
|
// trigger a new configuration change to ensure that the nav bar is updated in the same way.
|
||||||
|
int userId = ActivityManagerWrapper.getInstance().getCurrentUserId();
|
||||||
|
if (userId != UserHandle.USER_SYSTEM) {
|
||||||
|
mHandler.post(() -> {
|
||||||
|
FragmentHostManager fragmentHost = FragmentHostManager.get(mNavigationBarView);
|
||||||
|
fragmentHost.reloadFragments();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disableAnimationsDuringHide(long delay) {
|
public void disableAnimationsDuringHide(long delay) {
|
||||||
|
|||||||
Reference in New Issue
Block a user