Merge commit 'e88846eeaf70f9f4299af9e3d54ba5dacede42b6' into eclair-plus-aosp * commit 'e88846eeaf70f9f4299af9e3d54ba5dacede42b6': Semi-workaround for #2027266: app drawer showing up on the side of the screen
This commit is contained in:
@@ -315,8 +315,12 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
|
|||||||
case ACTIVITY_IDLE_TRANSACTION: {
|
case ACTIVITY_IDLE_TRANSACTION: {
|
||||||
data.enforceInterface(IActivityManager.descriptor);
|
data.enforceInterface(IActivityManager.descriptor);
|
||||||
IBinder token = data.readStrongBinder();
|
IBinder token = data.readStrongBinder();
|
||||||
|
Configuration config = null;
|
||||||
|
if (data.readInt() != 0) {
|
||||||
|
config = Configuration.CREATOR.createFromParcel(data);
|
||||||
|
}
|
||||||
if (token != null) {
|
if (token != null) {
|
||||||
activityIdle(token);
|
activityIdle(token, config);
|
||||||
}
|
}
|
||||||
reply.writeNoException();
|
reply.writeNoException();
|
||||||
return true;
|
return true;
|
||||||
@@ -1397,12 +1401,18 @@ class ActivityManagerProxy implements IActivityManager
|
|||||||
data.recycle();
|
data.recycle();
|
||||||
reply.recycle();
|
reply.recycle();
|
||||||
}
|
}
|
||||||
public void activityIdle(IBinder token) throws RemoteException
|
public void activityIdle(IBinder token, Configuration config) throws RemoteException
|
||||||
{
|
{
|
||||||
Parcel data = Parcel.obtain();
|
Parcel data = Parcel.obtain();
|
||||||
Parcel reply = Parcel.obtain();
|
Parcel reply = Parcel.obtain();
|
||||||
data.writeInterfaceToken(IActivityManager.descriptor);
|
data.writeInterfaceToken(IActivityManager.descriptor);
|
||||||
data.writeStrongBinder(token);
|
data.writeStrongBinder(token);
|
||||||
|
if (config != null) {
|
||||||
|
data.writeInt(1);
|
||||||
|
config.writeToParcel(data, 0);
|
||||||
|
} else {
|
||||||
|
data.writeInt(0);
|
||||||
|
}
|
||||||
mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
|
mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
|
||||||
reply.readException();
|
reply.readException();
|
||||||
data.recycle();
|
data.recycle();
|
||||||
|
|||||||
@@ -1116,6 +1116,7 @@ public final class ActivityThread {
|
|||||||
boolean stopped;
|
boolean stopped;
|
||||||
boolean hideForNow;
|
boolean hideForNow;
|
||||||
Configuration newConfig;
|
Configuration newConfig;
|
||||||
|
Configuration createdConfig;
|
||||||
ActivityRecord nextIdle;
|
ActivityRecord nextIdle;
|
||||||
|
|
||||||
ActivityInfo activityInfo;
|
ActivityInfo activityInfo;
|
||||||
@@ -1944,7 +1945,8 @@ public final class ActivityThread {
|
|||||||
(a.activity != null ? a.activity.mFinished : false));
|
(a.activity != null ? a.activity.mFinished : false));
|
||||||
if (a.activity != null && !a.activity.mFinished) {
|
if (a.activity != null && !a.activity.mFinished) {
|
||||||
try {
|
try {
|
||||||
am.activityIdle(a.token);
|
am.activityIdle(a.token, a.createdConfig);
|
||||||
|
a.createdConfig = null;
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2464,6 +2466,7 @@ public final class ActivityThread {
|
|||||||
Activity a = performLaunchActivity(r, customIntent);
|
Activity a = performLaunchActivity(r, customIntent);
|
||||||
|
|
||||||
if (a != null) {
|
if (a != null) {
|
||||||
|
r.createdConfig = new Configuration(a.getResources().getConfiguration());
|
||||||
handleResumeActivity(r.token, false, r.isForward);
|
handleResumeActivity(r.token, false, r.isForward);
|
||||||
|
|
||||||
if (!r.activity.mFinished && r.startsNotResumed) {
|
if (!r.activity.mFinished && r.startsNotResumed) {
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ public interface IActivityManager extends IInterface {
|
|||||||
public void setPersistent(IBinder token, boolean isPersistent) throws RemoteException;
|
public void setPersistent(IBinder token, boolean isPersistent) throws RemoteException;
|
||||||
public void attachApplication(IApplicationThread app) throws RemoteException;
|
public void attachApplication(IApplicationThread app) throws RemoteException;
|
||||||
/* oneway */
|
/* oneway */
|
||||||
public void activityIdle(IBinder token) throws RemoteException;
|
public void activityIdle(IBinder token, Configuration config) throws RemoteException;
|
||||||
public void activityPaused(IBinder token, Bundle state) throws RemoteException;
|
public void activityPaused(IBinder token, Bundle state) throws RemoteException;
|
||||||
/* oneway */
|
/* oneway */
|
||||||
public void activityStopped(IBinder token,
|
public void activityStopped(IBinder token,
|
||||||
|
|||||||
@@ -1093,7 +1093,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
|||||||
// so we need to be conservative and assume it isn't.
|
// so we need to be conservative and assume it isn't.
|
||||||
IBinder token = (IBinder)msg.obj;
|
IBinder token = (IBinder)msg.obj;
|
||||||
Log.w(TAG, "Activity idle timeout for " + token);
|
Log.w(TAG, "Activity idle timeout for " + token);
|
||||||
activityIdleInternal(token, true);
|
activityIdleInternal(token, true, null);
|
||||||
} break;
|
} break;
|
||||||
case DESTROY_TIMEOUT_MSG: {
|
case DESTROY_TIMEOUT_MSG: {
|
||||||
IBinder token = (IBinder)msg.obj;
|
IBinder token = (IBinder)msg.obj;
|
||||||
@@ -1104,7 +1104,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
|||||||
} break;
|
} break;
|
||||||
case IDLE_NOW_MSG: {
|
case IDLE_NOW_MSG: {
|
||||||
IBinder token = (IBinder)msg.obj;
|
IBinder token = (IBinder)msg.obj;
|
||||||
activityIdle(token);
|
activityIdle(token, null);
|
||||||
} break;
|
} break;
|
||||||
case SERVICE_TIMEOUT_MSG: {
|
case SERVICE_TIMEOUT_MSG: {
|
||||||
if (mDidDexOpt) {
|
if (mDidDexOpt) {
|
||||||
@@ -5419,9 +5419,9 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void activityIdle(IBinder token) {
|
public final void activityIdle(IBinder token, Configuration config) {
|
||||||
final long origId = Binder.clearCallingIdentity();
|
final long origId = Binder.clearCallingIdentity();
|
||||||
activityIdleInternal(token, false);
|
activityIdleInternal(token, false, config);
|
||||||
Binder.restoreCallingIdentity(origId);
|
Binder.restoreCallingIdentity(origId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5474,7 +5474,8 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
|||||||
mWindowManager.enableScreenAfterBoot();
|
mWindowManager.enableScreenAfterBoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
final void activityIdleInternal(IBinder token, boolean fromTimeout) {
|
final void activityIdleInternal(IBinder token, boolean fromTimeout,
|
||||||
|
Configuration config) {
|
||||||
if (localLOGV) Log.v(TAG, "Activity idle: " + token);
|
if (localLOGV) Log.v(TAG, "Activity idle: " + token);
|
||||||
|
|
||||||
ArrayList<HistoryRecord> stops = null;
|
ArrayList<HistoryRecord> stops = null;
|
||||||
@@ -5497,6 +5498,15 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
|||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
HistoryRecord r = (HistoryRecord)mHistory.get(index);
|
HistoryRecord r = (HistoryRecord)mHistory.get(index);
|
||||||
|
|
||||||
|
// This is a hack to semi-deal with a race condition
|
||||||
|
// in the client where it can be constructed with a
|
||||||
|
// newer configuration from when we asked it to launch.
|
||||||
|
// We'll update with whatever configuration it now says
|
||||||
|
// it used to launch.
|
||||||
|
if (config != null) {
|
||||||
|
r.configuration = config;
|
||||||
|
}
|
||||||
|
|
||||||
// No longer need to keep the device awake.
|
// No longer need to keep the device awake.
|
||||||
if (mResumedActivity == r && mLaunchingActivity.isHeld()) {
|
if (mResumedActivity == r && mLaunchingActivity.isHeld()) {
|
||||||
mHandler.removeMessages(LAUNCH_TIMEOUT_MSG);
|
mHandler.removeMessages(LAUNCH_TIMEOUT_MSG);
|
||||||
|
|||||||
Reference in New Issue
Block a user