diff options
| author | Dianne Hackborn <hackbod@google.com> | 2009-12-11 15:24:33 -0800 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2009-12-11 15:24:33 -0800 |
| commit | 871ecdce67fb59a2603c1b93db657fe8b65695bd (patch) | |
| tree | 3ffc60fc7d7235c4bfab859ee86bd701a981daf8 /core/java | |
| parent | f9b0e826689cca5ecbd40aa49f3ea7f7c73ad2a2 (diff) | |
| download | frameworks_base-871ecdce67fb59a2603c1b93db657fe8b65695bd.zip frameworks_base-871ecdce67fb59a2603c1b93db657fe8b65695bd.tar.gz frameworks_base-871ecdce67fb59a2603c1b93db657fe8b65695bd.tar.bz2 | |
Fix issue #2304284: contacts/dialer/recentcalls constantly flashing
Make sure the application is always given the most recent configuration
when launcher. Use the current configuration, instead of whatever happens
to be set by the app, for reporting what it was launched with.
Change-Id: I2ffe306f56cc9092b640546dd0a28d2c29b9c0b3
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 15 | ||||
| -rw-r--r-- | core/java/android/app/ApplicationThreadNative.java | 15 | ||||
| -rw-r--r-- | core/java/android/app/IApplicationThread.java | 2 |
3 files changed, 27 insertions, 5 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 1115f92..909620d 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -1383,13 +1383,14 @@ public final class ActivityThread { public final void scheduleRelaunchActivity(IBinder token, List<ResultInfo> pendingResults, List<Intent> pendingNewIntents, - int configChanges, boolean notResumed) { + int configChanges, boolean notResumed, Configuration config) { ActivityRecord r = new ActivityRecord(); r.token = token; r.pendingResults = pendingResults; r.pendingIntents = pendingNewIntents; r.startsNotResumed = notResumed; + r.createdConfig = config; synchronized (mRelaunchingActivities) { mRelaunchingActivities.add(r); @@ -2511,7 +2512,7 @@ public final class ActivityThread { Activity a = performLaunchActivity(r, customIntent); if (a != null) { - r.createdConfig = new Configuration(a.getResources().getConfiguration()); + r.createdConfig = new Configuration(mConfiguration); handleResumeActivity(r.token, false, r.isForward); if (!r.activity.mFinished && r.startsNotResumed) { @@ -3563,6 +3564,16 @@ public final class ActivityThread { } } + if (tmp.createdConfig != null) { + // If the activity manager is passing us its current config, + // assume that is really what we want regardless of what we + // may have pending. + if (mConfiguration == null + || mConfiguration.diff(tmp.createdConfig) != 0) { + changedConfig = tmp.createdConfig; + } + } + if (DEBUG_CONFIGURATION) Log.v(TAG, "Relaunching activity " + tmp.token + ": changedConfig=" + changedConfig); diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java index a772a8f..7cba13f 100644 --- a/core/java/android/app/ApplicationThreadNative.java +++ b/core/java/android/app/ApplicationThreadNative.java @@ -140,7 +140,11 @@ public abstract class ApplicationThreadNative extends Binder List<Intent> pi = data.createTypedArrayList(Intent.CREATOR); int configChanges = data.readInt(); boolean notResumed = data.readInt() != 0; - scheduleRelaunchActivity(b, ri, pi, configChanges, notResumed); + Configuration config = null; + if (data.readInt() != 0) { + config = Configuration.CREATOR.createFromParcel(data); + } + scheduleRelaunchActivity(b, ri, pi, configChanges, notResumed, config); return true; } @@ -491,7 +495,8 @@ class ApplicationThreadProxy implements IApplicationThread { public final void scheduleRelaunchActivity(IBinder token, List<ResultInfo> pendingResults, List<Intent> pendingNewIntents, - int configChanges, boolean notResumed) throws RemoteException { + int configChanges, boolean notResumed, Configuration config) + throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeStrongBinder(token); @@ -499,6 +504,12 @@ class ApplicationThreadProxy implements IApplicationThread { data.writeTypedList(pendingNewIntents); data.writeInt(configChanges); data.writeInt(notResumed ? 1 : 0); + if (config != null) { + data.writeInt(1); + config.writeToParcel(data, 0); + } else { + data.writeInt(0); + } mRemote.transact(SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); data.recycle(); diff --git a/core/java/android/app/IApplicationThread.java b/core/java/android/app/IApplicationThread.java index 89a52fd..ed810d3 100644 --- a/core/java/android/app/IApplicationThread.java +++ b/core/java/android/app/IApplicationThread.java @@ -56,7 +56,7 @@ public interface IApplicationThread extends IInterface { throws RemoteException; void scheduleRelaunchActivity(IBinder token, List<ResultInfo> pendingResults, List<Intent> pendingNewIntents, int configChanges, - boolean notResumed) throws RemoteException; + boolean notResumed, Configuration config) throws RemoteException; void scheduleNewIntent(List<Intent> intent, IBinder token) throws RemoteException; void scheduleDestroyActivity(IBinder token, boolean finished, int configChanges) throws RemoteException; |
