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

Commit fac74769 authored by Chong Zhang's avatar Chong Zhang Committed by android-build-merger
Browse files

Merge \"Do not send unhandled system config changes to app\" into nyc-mr1-dev

am: 568507ab

Change-Id: I4a711464f49c44f329e51d781dbe0eb4886d9c98
parents 2f3476de 568507ab
Loading
Loading
Loading
Loading
+11 −1
Original line number Original line Diff line number Diff line
@@ -236,6 +236,7 @@ public final class ActivityThread {
    boolean mSystemThread = false;
    boolean mSystemThread = false;
    boolean mJitEnabled = false;
    boolean mJitEnabled = false;
    boolean mSomeActivitiesChanged = false;
    boolean mSomeActivitiesChanged = false;
    boolean mUpdatingSystemConfig = false;


    // These can be accessed by multiple threads; mPackages is the lock.
    // These can be accessed by multiple threads; mPackages is the lock.
    // XXX For now we keep around information about all packages we have
    // XXX For now we keep around information about all packages we have
@@ -1574,7 +1575,9 @@ public final class ActivityThread {
                case CONFIGURATION_CHANGED:
                case CONFIGURATION_CHANGED:
                    Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "configChanged");
                    Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "configChanged");
                    mCurDefaultDisplayDpi = ((Configuration)msg.obj).densityDpi;
                    mCurDefaultDisplayDpi = ((Configuration)msg.obj).densityDpi;
                    mUpdatingSystemConfig = true;
                    handleConfigurationChanged((Configuration)msg.obj, null);
                    handleConfigurationChanged((Configuration)msg.obj, null);
                    mUpdatingSystemConfig = false;
                    Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
                    Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
                    break;
                    break;
                case CLEAN_UP_CONTEXT:
                case CLEAN_UP_CONTEXT:
@@ -4629,9 +4632,16 @@ public final class ActivityThread {
            // onConfigurationChanged
            // onConfigurationChanged
            int diff = activity.mCurrentConfig.diff(newConfig);
            int diff = activity.mCurrentConfig.diff(newConfig);
            if (diff != 0) {
            if (diff != 0) {
                // Always send the task-level config changes. For system-level configuration, if
                // this activity doesn't handle any of the config changes, then don't bother
                // calling onConfigurationChanged as we're going to destroy it.
                if (!mUpdatingSystemConfig
                        || (~activity.mActivityInfo.getRealConfigChanged() & diff) == 0
                        || !reportToActivity) {
                    shouldChangeConfig = true;
                    shouldChangeConfig = true;
                }
                }
            }
            }
        }


        if (shouldChangeConfig) {
        if (shouldChangeConfig) {
            // Propagate the configuration change to the Activity and ResourcesManager.
            // Propagate the configuration change to the Activity and ResourcesManager.