* commit 'e6f6380027d5c209eb17ec2567f00356ad32038a': Fix issue #7196015: system_server deadlock during setup wizard
This commit is contained in:
@@ -3638,39 +3638,45 @@ public final class ActivityThread {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<ComponentCallbacks2> collectComponentCallbacksLocked(
|
ArrayList<ComponentCallbacks2> collectComponentCallbacks(
|
||||||
boolean allActivities, Configuration newConfig) {
|
boolean allActivities, Configuration newConfig) {
|
||||||
ArrayList<ComponentCallbacks2> callbacks
|
ArrayList<ComponentCallbacks2> callbacks
|
||||||
= new ArrayList<ComponentCallbacks2>();
|
= new ArrayList<ComponentCallbacks2>();
|
||||||
|
|
||||||
if (mActivities.size() > 0) {
|
synchronized (mPackages) {
|
||||||
for (ActivityClientRecord ar : mActivities.values()) {
|
final int N = mAllApplications.size();
|
||||||
Activity a = ar.activity;
|
for (int i=0; i<N; i++) {
|
||||||
if (a != null) {
|
callbacks.add(mAllApplications.get(i));
|
||||||
Configuration thisConfig = applyConfigCompatMainThread(mCurDefaultDisplayDpi,
|
}
|
||||||
newConfig, ar.packageInfo.mCompatibilityInfo.getIfNeeded());
|
if (mActivities.size() > 0) {
|
||||||
if (!ar.activity.mFinished && (allActivities || !ar.paused)) {
|
for (ActivityClientRecord ar : mActivities.values()) {
|
||||||
// If the activity is currently resumed, its configuration
|
Activity a = ar.activity;
|
||||||
// needs to change right now.
|
if (a != null) {
|
||||||
callbacks.add(a);
|
Configuration thisConfig = applyConfigCompatMainThread(mCurDefaultDisplayDpi,
|
||||||
} else if (thisConfig != null) {
|
newConfig, ar.packageInfo.mCompatibilityInfo.getIfNeeded());
|
||||||
// Otherwise, we will tell it about the change
|
if (!ar.activity.mFinished && (allActivities || !ar.paused)) {
|
||||||
// the next time it is resumed or shown. Note that
|
// If the activity is currently resumed, its configuration
|
||||||
// the activity manager may, before then, decide the
|
// needs to change right now.
|
||||||
// activity needs to be destroyed to handle its new
|
callbacks.add(a);
|
||||||
// configuration.
|
} else if (thisConfig != null) {
|
||||||
if (DEBUG_CONFIGURATION) {
|
// Otherwise, we will tell it about the change
|
||||||
Slog.v(TAG, "Setting activity "
|
// the next time it is resumed or shown. Note that
|
||||||
+ ar.activityInfo.name + " newConfig=" + thisConfig);
|
// 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;
|
||||||
}
|
}
|
||||||
ar.newConfig = thisConfig;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (mServices.size() > 0) {
|
||||||
if (mServices.size() > 0) {
|
for (Service service : mServices.values()) {
|
||||||
for (Service service : mServices.values()) {
|
callbacks.add(service);
|
||||||
callbacks.add(service);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
synchronized (mProviderMap) {
|
synchronized (mProviderMap) {
|
||||||
@@ -3680,10 +3686,6 @@ public final class ActivityThread {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final int N = mAllApplications.size();
|
|
||||||
for (int i=0; i<N; i++) {
|
|
||||||
callbacks.add(mAllApplications.get(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
return callbacks;
|
return callbacks;
|
||||||
}
|
}
|
||||||
@@ -3844,7 +3846,6 @@ public final class ActivityThread {
|
|||||||
|
|
||||||
final void handleConfigurationChanged(Configuration config, CompatibilityInfo compat) {
|
final void handleConfigurationChanged(Configuration config, CompatibilityInfo compat) {
|
||||||
|
|
||||||
ArrayList<ComponentCallbacks2> callbacks = null;
|
|
||||||
int configDiff = 0;
|
int configDiff = 0;
|
||||||
|
|
||||||
synchronized (mPackages) {
|
synchronized (mPackages) {
|
||||||
@@ -3875,9 +3876,10 @@ public final class ActivityThread {
|
|||||||
configDiff = mConfiguration.diff(config);
|
configDiff = mConfiguration.diff(config);
|
||||||
mConfiguration.updateFrom(config);
|
mConfiguration.updateFrom(config);
|
||||||
config = applyCompatConfiguration(mCurDefaultDisplayDpi);
|
config = applyCompatConfiguration(mCurDefaultDisplayDpi);
|
||||||
callbacks = collectComponentCallbacksLocked(false, config);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ArrayList<ComponentCallbacks2> callbacks = collectComponentCallbacks(false, config);
|
||||||
|
|
||||||
// Cleanup hardware accelerated stuff
|
// Cleanup hardware accelerated stuff
|
||||||
WindowManagerGlobal.getInstance().trimLocalMemory();
|
WindowManagerGlobal.getInstance().trimLocalMemory();
|
||||||
|
|
||||||
@@ -3990,11 +3992,7 @@ public final class ActivityThread {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final void handleLowMemory() {
|
final void handleLowMemory() {
|
||||||
ArrayList<ComponentCallbacks2> callbacks;
|
ArrayList<ComponentCallbacks2> callbacks = collectComponentCallbacks(true, null);
|
||||||
|
|
||||||
synchronized (mPackages) {
|
|
||||||
callbacks = collectComponentCallbacksLocked(true, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
final int N = callbacks.size();
|
final int N = callbacks.size();
|
||||||
for (int i=0; i<N; i++) {
|
for (int i=0; i<N; i++) {
|
||||||
@@ -4022,10 +4020,7 @@ public final class ActivityThread {
|
|||||||
final WindowManagerGlobal windowManager = WindowManagerGlobal.getInstance();
|
final WindowManagerGlobal windowManager = WindowManagerGlobal.getInstance();
|
||||||
windowManager.startTrimMemory(level);
|
windowManager.startTrimMemory(level);
|
||||||
|
|
||||||
ArrayList<ComponentCallbacks2> callbacks;
|
ArrayList<ComponentCallbacks2> callbacks = collectComponentCallbacks(true, null);
|
||||||
synchronized (mPackages) {
|
|
||||||
callbacks = collectComponentCallbacksLocked(true, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
final int N = callbacks.size();
|
final int N = callbacks.size();
|
||||||
for (int i = 0; i < N; i++) {
|
for (int i = 0; i < N; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user