am 6cd206b2: Merge "Relayout windows that handle their own config change." into klp-dev

* commit '6cd206b2aa0039c215fc0a4cc487471c4b3f1496':
  Relayout windows that handle their own config change.
This commit is contained in:
Craig Mautner
2013-11-12 15:58:28 -08:00
committed by Android Git Automerger
6 changed files with 17 additions and 9 deletions

View File

@ -78,7 +78,8 @@ interface IWindowManager
void addWindowToken(IBinder token, int type); void addWindowToken(IBinder token, int type);
void removeWindowToken(IBinder token); void removeWindowToken(IBinder token);
void addAppToken(int addPos, IApplicationToken token, int groupId, int stackId, void addAppToken(int addPos, IApplicationToken token, int groupId, int stackId,
int requestedOrientation, boolean fullscreen, boolean showWhenLocked, int userId); int requestedOrientation, boolean fullscreen, boolean showWhenLocked, int userId,
int configChanges);
void setAppGroupId(IBinder token, int groupId); void setAppGroupId(IBinder token, int groupId);
void setAppOrientation(IApplicationToken token, int requestedOrientation); void setAppOrientation(IApplicationToken token, int requestedOrientation);
int getAppOrientation(IApplicationToken token); int getAppOrientation(IApplicationToken token);

View File

@ -1717,7 +1717,7 @@ final class ActivityStack {
mWindowManager.addAppToken(task.mActivities.indexOf(r), r.appToken, mWindowManager.addAppToken(task.mActivities.indexOf(r), r.appToken,
r.task.taskId, mStackId, r.info.screenOrientation, r.fullscreen, r.task.taskId, mStackId, r.info.screenOrientation, r.fullscreen,
(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0, (r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0,
r.userId); r.userId, r.info.configChanges);
if (VALIDATE_TOKENS) { if (VALIDATE_TOKENS) {
validateAppTokensLocked(); validateAppTokensLocked();
} }
@ -1778,7 +1778,8 @@ final class ActivityStack {
r.updateOptionsLocked(options); r.updateOptionsLocked(options);
mWindowManager.addAppToken(task.mActivities.indexOf(r), mWindowManager.addAppToken(task.mActivities.indexOf(r),
r.appToken, r.task.taskId, mStackId, r.info.screenOrientation, r.fullscreen, r.appToken, r.task.taskId, mStackId, r.info.screenOrientation, r.fullscreen,
(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0, r.userId); (r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0, r.userId,
r.info.configChanges);
boolean doShow = true; boolean doShow = true;
if (newTask) { if (newTask) {
// Even though this activity is starting fresh, we still need // Even though this activity is starting fresh, we still need
@ -1821,7 +1822,8 @@ final class ActivityStack {
// because there is nothing for it to animate on top of. // because there is nothing for it to animate on top of.
mWindowManager.addAppToken(task.mActivities.indexOf(r), r.appToken, mWindowManager.addAppToken(task.mActivities.indexOf(r), r.appToken,
r.task.taskId, mStackId, r.info.screenOrientation, r.fullscreen, r.task.taskId, mStackId, r.info.screenOrientation, r.fullscreen,
(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0, r.userId); (r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0, r.userId,
r.info.configChanges);
ActivityOptions.abort(options); ActivityOptions.abort(options);
} }
if (VALIDATE_TOKENS) { if (VALIDATE_TOKENS) {

View File

@ -53,6 +53,7 @@ class AppWindowToken extends WindowToken {
int groupId = -1; int groupId = -1;
boolean appFullscreen; boolean appFullscreen;
int requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; int requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
int configChanges;
boolean showWhenLocked; boolean showWhenLocked;
// The input dispatching timeout for this application token in nanoseconds. // The input dispatching timeout for this application token in nanoseconds.

View File

@ -3406,7 +3406,8 @@ public class WindowManagerService extends IWindowManager.Stub
@Override @Override
public void addAppToken(int addPos, IApplicationToken token, int taskId, int stackId, public void addAppToken(int addPos, IApplicationToken token, int taskId, int stackId,
int requestedOrientation, boolean fullscreen, boolean showWhenLocked, int userId) { int requestedOrientation, boolean fullscreen, boolean showWhenLocked, int userId,
int configChanges) {
if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS, if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
"addAppToken()")) { "addAppToken()")) {
throw new SecurityException("Requires MANAGE_APP_TOKENS permission"); throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
@ -3438,6 +3439,7 @@ public class WindowManagerService extends IWindowManager.Stub
atoken.appFullscreen = fullscreen; atoken.appFullscreen = fullscreen;
atoken.showWhenLocked = showWhenLocked; atoken.showWhenLocked = showWhenLocked;
atoken.requestedOrientation = requestedOrientation; atoken.requestedOrientation = requestedOrientation;
atoken.configChanges = configChanges;
if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, "addAppToken: " + atoken if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, "addAppToken: " + atoken
+ " to stack=" + stackId + " task=" + taskId + " at " + addPos); + " to stack=" + stackId + " task=" + taskId + " at " + addPos);
@ -8267,8 +8269,10 @@ public class WindowManagerService extends IWindowManager.Stub
// windows, since that means "perform layout as normal, // windows, since that means "perform layout as normal,
// just don't display"). // just don't display").
if (!gone || !win.mHaveFrame || win.mLayoutNeeded if (!gone || !win.mHaveFrame || win.mLayoutNeeded
|| win.mAttrs.type == TYPE_KEYGUARD && win.isConfigChanged() || win.isConfigChanged() && (win.mAttrs.type == TYPE_KEYGUARD ||
|| mOpeningApps.contains(win.mAppToken) (win.mAppToken != null && (win.mAppToken.configChanges &
(ActivityInfo.CONFIG_SCREEN_SIZE | ActivityInfo.CONFIG_ORIENTATION))
!= 0))
|| win.mAttrs.type == TYPE_UNIVERSE_BACKGROUND) { || win.mAttrs.type == TYPE_UNIVERSE_BACKGROUND) {
if (!win.mLayoutAttached) { if (!win.mLayoutAttached) {
if (initial) { if (initial) {

View File

@ -93,7 +93,7 @@ public class WindowManagerPermissionTests extends TestCase {
} }
try { try {
mWm.addAppToken(0, null, 0, 0, 0, false, false, 0); mWm.addAppToken(0, null, 0, 0, 0, false, false, 0, 0);
fail("IWindowManager.addAppToken did not throw SecurityException as" fail("IWindowManager.addAppToken did not throw SecurityException as"
+ " expected"); + " expected");
} catch (SecurityException e) { } catch (SecurityException e) {

View File

@ -81,7 +81,7 @@ public class IWindowManagerImpl implements IWindowManager {
@Override @Override
public void addAppToken(int arg0, IApplicationToken arg1, int arg2, int arg3, int arg4, public void addAppToken(int arg0, IApplicationToken arg1, int arg2, int arg3, int arg4,
boolean arg5, boolean arg6, int arg7) boolean arg5, boolean arg6, int arg7, int arg8)
throws RemoteException { throws RemoteException {
// TODO Auto-generated method stub // TODO Auto-generated method stub