From b0c0b1fd70e3edeb724e2b2fb2c7063eb943f05e Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Wed, 13 Feb 2013 15:22:54 -0800 Subject: [PATCH] Remove unused App methods. Now that the Task methods have replaced the App methods remove the App methods. Change-Id: I0e7432f2c6f99708759ed8c871d20eb5bd38c3c2 --- core/java/android/view/IWindowManager.aidl | 3 - .../com/android/server/am/ActivityStack.java | 4 - .../com/android/server/wm/DisplayContent.java | 25 -- .../server/wm/WindowManagerService.java | 288 ------------------ .../src/android/view/IWindowManagerImpl.java | 18 -- 5 files changed, 338 deletions(-) diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl index a9ad97f61ed68..885327cf2bb4b 100644 --- a/core/java/android/view/IWindowManager.aidl +++ b/core/java/android/view/IWindowManager.aidl @@ -97,9 +97,6 @@ interface IWindowManager void startAppFreezingScreen(IBinder token, int configChanges); void stopAppFreezingScreen(IBinder token, boolean force); void removeAppToken(IBinder token); - void moveAppToken(int index, IBinder token); - void moveAppTokensToTop(in List tokens); - void moveAppTokensToBottom(in List tokens); // Re-evaluate the current orientation from the caller's state. // If there is a change, the new Configuration is returned and the diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java index 84d5a72876c5f..c54cdaa36b9e0 100644 --- a/services/java/com/android/server/am/ActivityStack.java +++ b/services/java/com/android/server/am/ActivityStack.java @@ -2145,7 +2145,6 @@ final class ActivityStack { } mHistory.remove(srcPos); mHistory.add(dstPos, p); -// mService.mWindowManager.moveAppToken(dstPos, p.appToken); mService.mWindowManager.setAppGroupId(p.appToken, taskId); dstPos++; i++; @@ -2297,7 +2296,6 @@ final class ActivityStack { if (DEBUG_TASKS) Slog.v(TAG, "Pulling activity " + p + " from " + srcPos + " to " + lastReparentPos + " in to resetting task " + task); -// mService.mWindowManager.moveAppToken(lastReparentPos, p.appToken); mService.mWindowManager.setAppGroupId(p.appToken, taskId); } // TODO: This is wrong because it doesn't take lastReparentPos into account. @@ -4566,7 +4564,6 @@ final class ActivityStack { updateTransitLocked(AppTransition.TRANSIT_TASK_TO_FRONT, options); } -// mService.mWindowManager.moveAppTokensToTop(moved); mService.mWindowManager.moveTaskToTop(task); if (VALIDATE_TOKENS) { validateAppTokensLocked(); @@ -4659,7 +4656,6 @@ final class ActivityStack { mService.mWindowManager.prepareAppTransition( AppTransition.TRANSIT_TASK_TO_BACK, false); } -// mService.mWindowManager.moveAppTokensToBottom(moved); mService.mWindowManager.moveTaskToBottom(task); if (VALIDATE_TOKENS) { validateAppTokensLocked(); diff --git a/services/java/com/android/server/wm/DisplayContent.java b/services/java/com/android/server/wm/DisplayContent.java index f8e779debd6c7..0b6c514de8a27 100644 --- a/services/java/com/android/server/wm/DisplayContent.java +++ b/services/java/com/android/server/wm/DisplayContent.java @@ -307,31 +307,6 @@ class DisplayContent { } } - void verifyAppTokens() { - AppTokenIterator iterator = new AppTokenIterator(); - for (int i = 0; i < mAppTokens.size(); ++i) { - if (!iterator.hasNext()) { - Slog.e(TAG, "compareAppTokens: More mAppTokens than TaskList tokens. Callers=" - + Debug.getCallers(4)); - while (i < mAppTokens.size()) { - Slog.e(TAG, "compareAppTokens: mAppTokens[" + i + "]=" + mAppTokens.get(i)); - i++; - } - return; - } - AppWindowToken appToken = mAppTokens.get(i); - AppWindowToken taskListToken = iterator.next(); - if (appToken != taskListToken) { - Slog.e(TAG, "compareAppTokens: Mismatch at " + i + " appToken=" + appToken - + " taskListToken=" + taskListToken + ". Callers=" + Debug.getCallers(4)); - } - } - if (iterator.hasNext()) { - Slog.e(TAG, "compareAppTokens: More TaskList tokens than mAppTokens Callers=" - + Debug.getCallers(4)); - } - } - public void dump(String prefix, PrintWriter pw) { pw.print(prefix); pw.print("Display: mDisplayId="); pw.println(mDisplayId); final String subPrefix = " " + prefix; diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index a4b5a56ab0020..5bae807925d8f 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -4397,61 +4397,6 @@ public class WindowManagerService extends IWindowManager.Stub } } - private int findWindowOffsetLocked(DisplayContent displayContent, int tokenPos) { - final WindowList windows = displayContent.getWindowList(); - final int NW = windows.size(); - - if (tokenPos >= displayContent.mAnimatingAppTokens.size()) { - int i = NW; - while (i > 0) { - i--; - WindowState win = windows.get(i); - if (win.getAppToken() != null) { - return i+1; - } - } - } - - final AppTokenList appTokens = displayContent.mAppTokens; - while (tokenPos > 0) { - // Find the first app token below the new position that has - // a window displayed. - final AppWindowToken wtoken = appTokens.get(tokenPos-1); - if (DEBUG_REORDER) Slog.v(TAG, "Looking for lower windows @ " - + tokenPos + " -- " + wtoken.token); - if (wtoken.sendingToBottom) { - if (DEBUG_REORDER) Slog.v(TAG, - "Skipping token -- currently sending to bottom"); - tokenPos--; - continue; - } - for (int i = wtoken.windows.size() - 1; i >= 0; --i) { - WindowState win = wtoken.windows.get(i); - for (int j = win.mChildWindows.size() - 1; j >= 0; --j) { - WindowState cwin = win.mChildWindows.get(j); - if (cwin.mSubLayer >= 0) { - for (int pos = NW - 1; pos >= 0; pos--) { - if (windows.get(pos) == cwin) { - if (DEBUG_REORDER) Slog.v(TAG, - "Found child win @" + (pos + 1)); - return pos + 1; - } - } - } - } - for (int pos = NW - 1; pos >= 0; pos--) { - if (windows.get(pos) == win) { - if (DEBUG_REORDER) Slog.v(TAG, "Found win @" + (pos + 1)); - return pos + 1; - } - } - } - tokenPos--; - } - - return 0; - } - private int findAppWindowInsertionPointLocked(AppWindowToken target) { final int taskId = target.groupId; DisplayContent displayContent = mTaskIdToDisplayContents.get(taskId); @@ -4547,215 +4492,6 @@ public class WindowManagerService extends IWindowManager.Stub return index; } - @Override - public void moveAppToken(int index, IBinder token) { - if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS, - "moveAppToken()")) { - throw new SecurityException("Requires MANAGE_APP_TOKENS permission"); - } - - synchronized(mWindowMap) { - if (DEBUG_REORDER) Slog.v(TAG, "Initial app tokens:"); - if (DEBUG_REORDER) dumpAppTokensLocked(); - final AppWindowToken wtoken = findAppWindowToken(token); - DisplayContent displayContent = mTaskIdToDisplayContents.get(wtoken.groupId); - final AppTokenList appTokens = displayContent.mAppTokens; - final int oldIndex = appTokens.indexOf(wtoken); - if (DEBUG_TOKEN_MOVEMENT || DEBUG_REORDER) Slog.v(TAG, - "Start moving token " + wtoken + " initially at " - + oldIndex); - if (oldIndex > index && mAppTransition.isTransitionSet()) { - // animation towards back has not started, copy old list for duration of animation. - displayContent.refillAnimatingAppTokens(); - } - if (wtoken == null || !appTokens.remove(wtoken)) { - Slog.w(TAG, "Attempting to reorder token that doesn't exist: " - + token + " (" + wtoken + ")"); - return; - } - appTokens.add(index, wtoken); - if (DEBUG_REORDER) Slog.v(TAG, "Moved " + token + " to " + index + ":"); - else if (DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, "Moved " + token + " to " + index); - if (DEBUG_REORDER) dumpAppTokensLocked(); - if (!mAppTransition.isTransitionSet()) { - // Not animating, bring animating app list in line with mAppTokens. - displayContent.refillAnimatingAppTokens(); - - // Bring window ordering, window focus and input window in line with new app token - final long origId = Binder.clearCallingIdentity(); - if (DEBUG_REORDER) Slog.v(TAG, "Removing windows in " + token + ":"); - if (DEBUG_REORDER) dumpWindowsLocked(); - if (tmpRemoveAppWindowsLocked(wtoken)) { - if (DEBUG_REORDER) Slog.v(TAG, "Adding windows back in:"); - if (DEBUG_REORDER) dumpWindowsLocked(); - DisplayContentsIterator iterator = new DisplayContentsIterator(); - while(iterator.hasNext()) { - displayContent = iterator.next(); - final int pos = findWindowOffsetLocked(displayContent, index); - final int newPos = reAddAppWindowsLocked(displayContent, pos, wtoken); - if (pos != newPos) { - displayContent.layoutNeeded = true; - } - } - if (DEBUG_REORDER) Slog.v(TAG, "Final window list:"); - if (DEBUG_REORDER) dumpWindowsLocked(); - updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES, - false /*updateInputWindows*/); - mInputMonitor.setUpdateInputWindowsNeededLw(); - performLayoutAndPlaceSurfacesLocked(); - mInputMonitor.updateInputWindowsLw(false /*force*/); - } - Binder.restoreCallingIdentity(origId); - } - } - } - - private void removeAppTokensLocked(List tokens) { - // XXX This should be done more efficiently! - // (take advantage of the fact that both lists should be - // ordered in the same way.) - int N = tokens.size(); - for (int i=0; i tokens, DisplayContent displayContent, - int tokenPos) { - if (DEBUG_TASK_MOVEMENT) { - mSavedWindows = new WindowList(displayContent.getWindowList()); - } - // First remove all of the windows from the list. - final int N = tokens.size(); - int i; - for (i=0; i tokens) { - if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS, - "moveAppTokensToTop()")) { - throw new SecurityException("Requires MANAGE_APP_TOKENS permission"); - } - - final long origId = Binder.clearCallingIdentity(); - synchronized(mWindowMap) { - DisplayContent displayContent = null; - removeAppTokensLocked(tokens); - final int N = tokens.size(); - for (int i=0; i tokens) { - if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS, - "moveAppTokensToBottom()")) { - throw new SecurityException("Requires MANAGE_APP_TOKENS permission"); - } - - final long origId = Binder.clearCallingIdentity(); - synchronized(mWindowMap) { - DisplayContent displayContent = null; - final int N = tokens.size(); - if (N > 0) { - // animating towards back, hang onto old list for duration of animation. - AppWindowToken wt = findAppWindowToken(tokens.get(0)); - if (wt != null) { - displayContent = mTaskIdToDisplayContents.get(wt.groupId); - displayContent.refillAnimatingAppTokens(); - } - } - removeAppTokensLocked(tokens); - int pos = 0; - for (int i=0; i arg0) throws RemoteException { - // TODO Auto-generated method stub - - } - - @Override - public void moveAppTokensToTop(List arg0) throws RemoteException { - // TODO Auto-generated method stub - - } - @Override public IWindowSession openSession(IInputMethodClient arg0, IInputContext arg1) throws RemoteException {