Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a35495ff authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Add workaround to handle overlay package changes for non-primary users" into qt-dev

parents 82f98334 46d10aad
Loading
Loading
Loading
Loading
+8 −11
Original line number Diff line number Diff line
@@ -156,10 +156,7 @@ public class FragmentHostManager {
     */
    protected void onConfigurationChanged(Configuration newConfig) {
        if (mConfigChanges.applyNewConfig(mContext.getResources())) {
            // Save the old state.
            Parcelable p = destroyFragmentHost();
            // Generate a new fragment host and restore its state.
            createFragmentHost(p);
            reloadFragments();
        } else {
            mFragments.dispatchConfigurationChanged(newConfig);
        }
@@ -217,6 +214,13 @@ public class FragmentHostManager {
        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> {
        public HostCallbacks() {
            super(mContext, FragmentHostManager.this.mHandler, 0);
@@ -293,13 +297,6 @@ public class FragmentHostManager {
            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) {
            Context extensionContext = mExtensionLookup.get(className);
            if (extensionContext != null) {
+11 −0
Original line number Diff line number Diff line
@@ -979,6 +979,17 @@ public class NavigationBarFragment extends LifecycleFragment implements Callback
    public void onNavigationModeChanged(int mode) {
        mNavBarMode = mode;
        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) {