am 935cbda0: Merge change I174d16a3 into eclair
Merge commit '935cbda0df2d55247c30d65534ecf31b1ee164b5' into eclair-plus-aosp * commit '935cbda0df2d55247c30d65534ecf31b1ee164b5': Debugging for #2027266: app drawer showing up on the side
This commit is contained in:
@@ -141,6 +141,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
static final boolean DEBUG_USER_LEAVING = localLOGV || false;
|
||||
static final boolean DEBUG_RESULTS = localLOGV || false;
|
||||
static final boolean DEBUG_BACKUP = localLOGV || true;
|
||||
static final boolean DEBUG_CONFIGURATION = localLOGV || false;
|
||||
static final boolean VALIDATE_TOKENS = false;
|
||||
static final boolean SHOW_ACTIVITY_START_TIME = true;
|
||||
|
||||
@@ -5295,6 +5296,8 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
if (app.instrumentationClass != null) {
|
||||
ensurePackageDexOpt(app.instrumentationClass.getPackageName());
|
||||
}
|
||||
if (DEBUG_CONFIGURATION) Log.v(TAG, "Binding proc "
|
||||
+ processName + " with config " + mConfiguration);
|
||||
thread.bindApplication(processName, app.instrumentationInfo != null
|
||||
? app.instrumentationInfo : app.info, providers,
|
||||
app.instrumentationClass, app.instrumentationProfileFile,
|
||||
@@ -8327,6 +8330,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
// This happens before any activities are started, so we can
|
||||
// change mConfiguration in-place.
|
||||
mConfiguration.updateFrom(configuration);
|
||||
if (DEBUG_CONFIGURATION) Log.v(TAG, "Initial config: " + mConfiguration);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12714,7 +12718,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
Configuration newConfig = new Configuration(mConfiguration);
|
||||
changes = newConfig.updateFrom(values);
|
||||
if (changes != 0) {
|
||||
if (DEBUG_SWITCH) {
|
||||
if (DEBUG_SWITCH || DEBUG_CONFIGURATION) {
|
||||
Log.i(TAG, "Updating configuration to: " + values);
|
||||
}
|
||||
|
||||
@@ -12738,6 +12742,8 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
ProcessRecord app = mLRUProcesses.get(i);
|
||||
try {
|
||||
if (app.thread != null) {
|
||||
if (DEBUG_CONFIGURATION) Log.v(TAG, "Sending to proc "
|
||||
+ app.processName + " new config " + mConfiguration);
|
||||
app.thread.scheduleConfigurationChanged(mConfiguration);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -12821,19 +12827,21 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
*/
|
||||
private final boolean ensureActivityConfigurationLocked(HistoryRecord r,
|
||||
int globalChanges) {
|
||||
if (DEBUG_SWITCH) Log.i(TAG, "Ensuring correct configuration: " + r);
|
||||
if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Log.v(TAG,
|
||||
"Ensuring correct configuration: " + r);
|
||||
|
||||
// Short circuit: if the two configurations are the exact same
|
||||
// object (the common case), then there is nothing to do.
|
||||
Configuration newConfig = mConfiguration;
|
||||
if (r.configuration == newConfig) {
|
||||
if (DEBUG_SWITCH) Log.i(TAG, "Configuration unchanged in " + r);
|
||||
if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Log.v(TAG,
|
||||
"Configuration unchanged in " + r);
|
||||
return true;
|
||||
}
|
||||
|
||||
// We don't worry about activities that are finishing.
|
||||
if (r.finishing) {
|
||||
if (DEBUG_SWITCH) Log.i(TAG,
|
||||
if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Log.v(TAG,
|
||||
"Configuration doesn't matter in finishing " + r);
|
||||
r.stopFreezingScreenLocked(false);
|
||||
return true;
|
||||
@@ -12847,7 +12855,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
// If the activity isn't currently running, just leave the new
|
||||
// configuration and it will pick that up next time it starts.
|
||||
if (r.app == null || r.app.thread == null) {
|
||||
if (DEBUG_SWITCH) Log.i(TAG,
|
||||
if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Log.v(TAG,
|
||||
"Configuration doesn't matter not running " + r);
|
||||
r.stopFreezingScreenLocked(false);
|
||||
return true;
|
||||
@@ -12859,22 +12867,26 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
|
||||
// Figure out what has changed between the two configurations.
|
||||
int changes = oldConfig.diff(newConfig);
|
||||
if (DEBUG_SWITCH) {
|
||||
Log.i(TAG, "Checking to restart " + r.info.name + ": changed=0x"
|
||||
if (DEBUG_SWITCH || DEBUG_CONFIGURATION) {
|
||||
Log.v(TAG, "Checking to restart " + r.info.name + ": changed=0x"
|
||||
+ Integer.toHexString(changes) + ", handles=0x"
|
||||
+ Integer.toHexString(r.info.configChanges));
|
||||
+ Integer.toHexString(r.info.configChanges)
|
||||
+ ", newConfig=" + newConfig);
|
||||
}
|
||||
if ((changes&(~r.info.configChanges)) != 0) {
|
||||
// Aha, the activity isn't handling the change, so DIE DIE DIE.
|
||||
r.configChangeFlags |= changes;
|
||||
r.startFreezingScreenLocked(r.app, globalChanges);
|
||||
if (r.app == null || r.app.thread == null) {
|
||||
if (DEBUG_SWITCH) Log.i(TAG, "Switch is destroying non-running " + r);
|
||||
if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Log.v(TAG,
|
||||
"Switch is destroying non-running " + r);
|
||||
destroyActivityLocked(r, true);
|
||||
} else if (r.state == ActivityState.PAUSING) {
|
||||
// A little annoying: we are waiting for this activity to
|
||||
// finish pausing. Let's not do anything now, but just
|
||||
// flag that it needs to be restarted when done pausing.
|
||||
if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Log.v(TAG,
|
||||
"Switch is skipping already pausing " + r);
|
||||
r.configDestroy = true;
|
||||
return true;
|
||||
} else if (r.state == ActivityState.RESUMED) {
|
||||
@@ -12882,11 +12894,13 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
// and we need to restart the top, resumed activity.
|
||||
// Instead of doing the normal handshaking, just say
|
||||
// "restart!".
|
||||
if (DEBUG_SWITCH) Log.i(TAG, "Switch is restarting resumed " + r);
|
||||
if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Log.v(TAG,
|
||||
"Switch is restarting resumed " + r);
|
||||
relaunchActivityLocked(r, r.configChangeFlags, true);
|
||||
r.configChangeFlags = 0;
|
||||
} else {
|
||||
if (DEBUG_SWITCH) Log.i(TAG, "Switch is restarting non-resumed " + r);
|
||||
if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Log.v(TAG,
|
||||
"Switch is restarting non-resumed " + r);
|
||||
relaunchActivityLocked(r, r.configChangeFlags, false);
|
||||
r.configChangeFlags = 0;
|
||||
}
|
||||
@@ -12904,6 +12918,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
// it last got.
|
||||
if (r.app != null && r.app.thread != null) {
|
||||
try {
|
||||
if (DEBUG_CONFIGURATION) Log.v(TAG, "Sending new config to " + r);
|
||||
r.app.thread.scheduleActivityConfigurationChanged(r);
|
||||
} catch (RemoteException e) {
|
||||
// If process died, whatever.
|
||||
|
||||
Reference in New Issue
Block a user