diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 4ea2aacdf7c25..87c729b20c711 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -513,7 +513,6 @@ public final class ActivityThread extends ClientTransactionHandler { @UnsupportedAppUsage boolean stopped; boolean hideForNow; - Configuration newConfig; Configuration createdConfig; Configuration overrideConfig; // Used to save the last reported configuration from server side so that activity @@ -2222,21 +2221,6 @@ public final class ActivityThread extends ClientTransactionHandler { return sPermissionManager; } - private Configuration mMainThreadConfig = new Configuration(); - - Configuration applyConfigCompatMainThread(int displayDensity, Configuration config, - CompatibilityInfo compat) { - if (config == null) { - return null; - } - if (!compat.supportsScreen()) { - mMainThreadConfig.setTo(config); - config = mMainThreadConfig; - compat.applyToConfiguration(displayDensity, config); - } - return config; - } - /** * Creates the top level resources for the given package. Will return an existing * Resources if one has already been created. @@ -4597,14 +4581,6 @@ public final class ActivityThread extends ClientTransactionHandler { // The window is now visible if it has been added, we are not // simply finishing, and we are not starting another activity. if (!r.activity.mFinished && willBeVisible && r.activity.mDecor != null && !r.hideForNow) { - if (r.newConfig != null) { - performConfigurationChangedForActivity(r, r.newConfig); - if (DEBUG_CONFIGURATION) { - Slog.v(TAG, "Resuming activity " + r.activityInfo.name + " with newConfig " - + r.activity.mCurrentConfig); - } - r.newConfig = null; - } if (localLOGV) Slog.v(TAG, "Resuming " + r + " with isForward=" + isForward); ViewRootImpl impl = r.window.getDecorView().getViewRootImpl(); WindowManager.LayoutParams l = impl != null @@ -4910,13 +4886,6 @@ public final class ActivityThread extends ClientTransactionHandler { r.activity.makeVisible(); } } - if (r.newConfig != null) { - performConfigurationChangedForActivity(r, r.newConfig); - if (DEBUG_CONFIGURATION) Slog.v(TAG, "Updating activity vis " - + r.activityInfo.name + " with new config " - + r.activity.mCurrentConfig); - r.newConfig = null; - } } else { if (r.activity.mVisibleFromServer) { r.activity.mVisibleFromServer = false; @@ -5488,8 +5457,7 @@ public final class ActivityThread extends ClientTransactionHandler { } } - ArrayList collectComponentCallbacks( - boolean allActivities, Configuration newConfig) { + ArrayList collectComponentCallbacks(boolean includeActivities) { ArrayList callbacks = new ArrayList(); @@ -5498,29 +5466,11 @@ public final class ActivityThread extends ClientTransactionHandler { for (int i=0; i= 0; i--) { + final Activity a = mActivities.valueAt(i).activity; + if (a != null && !a.mFinished) { callbacks.add(a); - } else if (thisConfig != null) { - // Otherwise, we will tell it about the change - // the next time it is resumed or shown. Note that - // the activity manager may, before then, decide the - // activity needs to be destroyed to handle its new - // configuration. - if (DEBUG_CONFIGURATION) { - Slog.v(TAG, "Setting activity " - + ar.activityInfo.name + " newConfig=" + thisConfig); - } - ar.newConfig = thisConfig; } } } @@ -5543,17 +5493,6 @@ public final class ActivityThread extends ClientTransactionHandler { return callbacks; } - /** - * Updates the configuration for an Activity in its current display. - * - * @see #performConfigurationChangedForActivity(ActivityClientRecord, Configuration, int, - * boolean) - */ - private void performConfigurationChangedForActivity(ActivityClientRecord r, - Configuration newBaseConfig) { - performConfigurationChangedForActivity(r, newBaseConfig, r.activity.getDisplayId()); - } - /** * Updates the configuration for an Activity. The ActivityClientRecord's * {@link ActivityClientRecord#overrideConfig} is used to compute the final Configuration for @@ -5804,7 +5743,8 @@ public final class ActivityThread extends ClientTransactionHandler { } } - ArrayList callbacks = collectComponentCallbacks(false, config); + final ArrayList callbacks = + collectComponentCallbacks(false /* includeActivities */); freeTextLayoutCachesIfNeeded(configDiff); @@ -5812,13 +5752,7 @@ public final class ActivityThread extends ClientTransactionHandler { final int N = callbacks.size(); for (int i=0; i callbacks = collectComponentCallbacks(true, null); + final ArrayList callbacks = + collectComponentCallbacks(true /* includeActivities */); final int N = callbacks.size(); for (int i=0; i callbacks = collectComponentCallbacks(true, null); + final ArrayList callbacks = + collectComponentCallbacks(true /* includeActivities */); final int N = callbacks.size(); for (int i = 0; i < N; i++) {