summaryrefslogtreecommitdiff
path: root/core/java/android/app/ActivityThread.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-10-10 13:46:34 -0700
committerDianne Hackborn <hackbod@google.com>2011-10-10 14:53:08 -0700
commit58f42a59bda3bc912d0d2f81dc65a9d31d140eaa (patch)
tree01c6bed2aec11d4e09510f5962620c115661e90e /core/java/android/app/ActivityThread.java
parent8c3e707999359ed77bf1e2ac8465edae8dffc37c (diff)
Fix issue #5405788: Device continuously opening and closing...
...the "Complete action using" dialog When an application goes idle, it sends back to the activity manager the configuration it last used, to make sure the two don't get out of sync. Fix a bunch of edge cases here in dealing with that, and be sure to also send the current configuration when launching an activity so the client is always up-to-date when launching. Also a small fix to not show the upgrading dialog during first boot. Change-Id: I14ed366a87cd689d1c78787369e052422290ac6f
Diffstat (limited to 'core/java/android/app/ActivityThread.java')
-rw-r--r--core/java/android/app/ActivityThread.java25
1 files changed, 17 insertions, 8 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index d2facdcc172c..8afe9bf0468e 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -490,6 +490,15 @@ public final class ActivityThread {
// Formatting for checkin service - update version if row format changes
private static final int ACTIVITY_THREAD_CHECKIN_VERSION = 1;
+ private void updatePendingConfiguration(Configuration config) {
+ synchronized (mPackages) {
+ if (mPendingConfiguration == null ||
+ mPendingConfiguration.isOtherSeqNewer(config)) {
+ mPendingConfiguration = config;
+ }
+ }
+ }
+
public final void schedulePauseActivity(IBinder token, boolean finished,
boolean userLeaving, int configChanges) {
queueOrSendMessage(
@@ -530,8 +539,8 @@ public final class ActivityThread {
// we use token to identify this activity without having to send the
// activity itself back to the activity manager. (matters more with ipc)
public final void scheduleLaunchActivity(Intent intent, IBinder token, int ident,
- ActivityInfo info, CompatibilityInfo compatInfo, Bundle state,
- List<ResultInfo> pendingResults,
+ ActivityInfo info, Configuration curConfig, CompatibilityInfo compatInfo,
+ Bundle state, List<ResultInfo> pendingResults,
List<Intent> pendingNewIntents, boolean notResumed, boolean isForward,
String profileName, ParcelFileDescriptor profileFd, boolean autoStopProfiler) {
ActivityClientRecord r = new ActivityClientRecord();
@@ -553,6 +562,8 @@ public final class ActivityThread {
r.profileFd = profileFd;
r.autoStopProfiler = autoStopProfiler;
+ updatePendingConfiguration(curConfig);
+
queueOrSendMessage(H.LAUNCH_ACTIVITY, r);
}
@@ -697,12 +708,7 @@ public final class ActivityThread {
}
public void scheduleConfigurationChanged(Configuration config) {
- synchronized (mPackages) {
- if (mPendingConfiguration == null ||
- mPendingConfiguration.isOtherSeqNewer(config)) {
- mPendingConfiguration = config;
- }
- }
+ updatePendingConfiguration(config);
queueOrSendMessage(H.CONFIGURATION_CHANGED, config);
}
@@ -1966,6 +1972,9 @@ public final class ActivityThread {
mProfiler.autoStopProfiler = r.autoStopProfiler;
}
+ // Make sure we are running with the most recent config.
+ handleConfigurationChanged(null, null);
+
if (localLOGV) Slog.v(
TAG, "Handling launch of " + r);
Activity a = performLaunchActivity(r, customIntent);