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

Commit c8c9daaf authored by Winson Chung's avatar Winson Chung Committed by android-build-merger
Browse files

Merge "Merge "Add workaround to handle overlay package changes for non-primary...

Merge "Merge "Add workaround to handle overlay package changes for non-primary users" into qt-dev am: a35495ff am: ba8df42b" into qt-r1-dev-plus-aosp
am: 4a3a1116

Change-Id: Ic49969beeb4f20f89d5853ceb77c892b32ca9fc3
parents 29a7e58b 4a3a1116
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) {