diff options
Diffstat (limited to 'services/java')
8 files changed, 149 insertions, 53 deletions
diff --git a/services/java/com/android/server/AppWidgetServiceImpl.java b/services/java/com/android/server/AppWidgetServiceImpl.java index d0dd9cf..daa82f2 100644 --- a/services/java/com/android/server/AppWidgetServiceImpl.java +++ b/services/java/com/android/server/AppWidgetServiceImpl.java @@ -599,7 +599,7 @@ class AppWidgetServiceImpl { } public void bindAppWidgetId(int appWidgetId, ComponentName provider, Bundle options) { - mContext.enforceCallingPermission(android.Manifest.permission.BIND_APPWIDGET, + mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BIND_APPWIDGET, "bindAppWidgetId appWidgetId=" + appWidgetId + " provider=" + provider); bindAppWidgetIdImpl(appWidgetId, provider, options); } @@ -607,7 +607,7 @@ class AppWidgetServiceImpl { public boolean bindAppWidgetIdIfAllowed( String packageName, int appWidgetId, ComponentName provider, Bundle options) { try { - mContext.enforceCallingPermission(android.Manifest.permission.BIND_APPWIDGET, null); + mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BIND_APPWIDGET, null); } catch (SecurityException se) { if (!callerHasBindAppWidgetPermission(packageName)) { return false; diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index 0e51c47..c9ff595 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -730,7 +730,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub if (!updateOnlyWhenLocaleChanged) { hideCurrentInputLocked(0, null); mCurMethodId = null; - unbindCurrentMethodLocked(true); + unbindCurrentMethodLocked(true, false); } if (DEBUG) { Slog.i(TAG, "Locale has been changed to " + newLocale); @@ -1201,7 +1201,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub throw new IllegalArgumentException("Unknown id: " + mCurMethodId); } - unbindCurrentMethodLocked(false); + unbindCurrentMethodLocked(false, true); mCurIntent = new Intent(InputMethod.SERVICE_INTERFACE); mCurIntent.setComponent(info.getComponent()); @@ -1257,7 +1257,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub mCurMethod = IInputMethod.Stub.asInterface(service); if (mCurToken == null) { Slog.w(TAG, "Service connected without a token!"); - unbindCurrentMethodLocked(false); + unbindCurrentMethodLocked(false, false); return; } if (DEBUG) Slog.v(TAG, "Initiating attach with token: " + mCurToken); @@ -1292,7 +1292,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } } - void unbindCurrentMethodLocked(boolean reportToClient) { + void unbindCurrentMethodLocked(boolean reportToClient, boolean savePosition) { if (mVisibleBound) { mContext.unbindService(mVisibleConnection); mVisibleBound = false; @@ -1306,7 +1306,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub if (mCurToken != null) { try { if (DEBUG) Slog.v(TAG, "Removing window token: " + mCurToken); - if ((mImeWindowVis & InputMethodService.IME_ACTIVE) != 0) { + if ((mImeWindowVis & InputMethodService.IME_ACTIVE) != 0 && savePosition) { // The current IME is shown. Hence an IME switch (transition) is happening. mWindowManagerService.saveLastInputMethodWindowForTransition(); } @@ -1589,13 +1589,13 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } catch (IllegalArgumentException e) { Slog.w(TAG, "Unknown input method from prefs: " + id, e); mCurMethodId = null; - unbindCurrentMethodLocked(true); + unbindCurrentMethodLocked(true, false); } mShortcutInputMethodsAndSubtypes.clear(); } else { // There is no longer an input method set, so stop any current one. mCurMethodId = null; - unbindCurrentMethodLocked(true); + unbindCurrentMethodLocked(true, false); } } diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java index 37dee19..9416b52 100644 --- a/services/java/com/android/server/LocationManagerService.java +++ b/services/java/com/android/server/LocationManagerService.java @@ -224,7 +224,7 @@ public class LocationManagerService extends ILocationManager.Stub implements Run // listen for settings changes mContext.getContentResolver().registerContentObserver( - Settings.Secure.getUriFor(Settings.Secure.LOCATION_PROVIDERS_ALLOWED), true, + Settings.Secure.getUriFor(Settings.Secure.LOCATION_PROVIDERS_ALLOWED), true, new ContentObserver(mLocationHandler) { @Override public void onChange(boolean selfChange) { @@ -1540,7 +1540,8 @@ public class LocationManagerService extends ILocationManager.Stub implements Run } - private static boolean shouldBroadcastSafe(Location loc, Location lastLoc, UpdateRecord record) { + private static boolean shouldBroadcastSafe( + Location loc, Location lastLoc, UpdateRecord record, long now) { // Always broadcast the first update if (lastLoc == null) { return true; @@ -1561,6 +1562,16 @@ public class LocationManagerService extends ILocationManager.Stub implements Run } } + // Check whether sufficient number of udpates is left + if (record.mRequest.getNumUpdates() <= 0) { + return false; + } + + // Check whether the expiry date has passed + if (record.mRequest.getExpireAt() < now) { + return false; + } + return true; } @@ -1640,7 +1651,7 @@ public class LocationManagerService extends ILocationManager.Stub implements Run } if (notifyLocation != null) { Location lastLoc = r.mLastFixBroadcast; - if ((lastLoc == null) || shouldBroadcastSafe(notifyLocation, lastLoc, r)) { + if ((lastLoc == null) || shouldBroadcastSafe(notifyLocation, lastLoc, r, now)) { if (lastLoc == null) { lastLoc = new Location(notifyLocation); r.mLastFixBroadcast = lastLoc; @@ -1651,6 +1662,7 @@ public class LocationManagerService extends ILocationManager.Stub implements Run Slog.w(TAG, "RemoteException calling onLocationChanged on " + receiver); receiverDead = true; } + r.mRequest.decrementNumUpdates(); } } @@ -1666,7 +1678,7 @@ public class LocationManagerService extends ILocationManager.Stub implements Run } // track expired records - if (r.mRequest.getNumUpdates() == 0 || r.mRequest.getExpireAt() < now) { + if (r.mRequest.getNumUpdates() <= 0 || r.mRequest.getExpireAt() < now) { if (deadUpdateRecords == null) { deadUpdateRecords = new ArrayList<UpdateRecord>(); } diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java index 6b277c7..671cbfe 100644 --- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -40,7 +40,9 @@ import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.database.ContentObserver; +import android.graphics.Point; import android.graphics.Rect; +import android.hardware.display.DisplayManager; import android.hardware.input.InputManager; import android.net.Uri; import android.os.Binder; @@ -62,6 +64,7 @@ import android.text.TextUtils; import android.text.TextUtils.SimpleStringSplitter; import android.util.Slog; import android.util.SparseArray; +import android.view.Display; import android.view.IWindow; import android.view.IWindowManager; import android.view.InputDevice; @@ -137,6 +140,12 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { private final List<AccessibilityServiceInfo> mEnabledServicesForFeedbackTempList = new ArrayList<AccessibilityServiceInfo>(); + private final Rect mTempRect = new Rect(); + + private final Point mTempPoint = new Point(); + + private final Display mDefaultDisplay; + private final PackageManager mPackageManager; private final IWindowManager mWindowManagerService; @@ -194,6 +203,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { mWindowManagerService = (IWindowManager) ServiceManager.getService(Context.WINDOW_SERVICE); mSecurityPolicy = new SecurityPolicy(); mMainHandler = new MainHandler(mContext.getMainLooper()); + //TODO: (multi-display) We need to support multiple displays. + DisplayManager displayManager = (DisplayManager) + mContext.getSystemService(Context.DISPLAY_SERVICE); + mDefaultDisplay = displayManager.getDisplay(Display.DEFAULT_DISPLAY); registerBroadcastReceivers(); new AccessibilityContentObserver(mMainHandler).register( context.getContentResolver()); @@ -582,6 +595,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { * @param outBounds The output to which to write the focus bounds. * @return Whether accessibility focus was found and the bounds are populated. */ + // TODO: (multi-display) Make sure this works for multiple displays. boolean getAccessibilityFocusBoundsInActiveWindow(Rect outBounds) { // Instead of keeping track of accessibility focus events per // window to be able to find the focus in the active window, @@ -603,6 +617,13 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return false; } focus.getBoundsInScreen(outBounds); + // Clip to the window rectangle. + Rect windowBounds = mTempRect; + getActiveWindowBounds(windowBounds); + outBounds.intersect(windowBounds); + // Clip to the screen rectangle. + mDefaultDisplay.getRealSize(mTempPoint); + outBounds.intersect(0, 0, mTempPoint.x, mTempPoint.y); return true; } finally { client.removeConnection(connectionId); @@ -1330,6 +1351,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { AccessibilityEvent event = AccessibilityEvent.obtain( AccessibilityEvent.TYPE_ANNOUNCEMENT); event.getText().add(message); + event.setWindowId(mSecurityPolicy.getRetrievalAllowingWindowLocked()); sendAccessibilityEvent(event, mCurrentUserId); } } diff --git a/services/java/com/android/server/wm/WindowAnimator.java b/services/java/com/android/server/wm/WindowAnimator.java index c8d9cc3..54914c2 100644 --- a/services/java/com/android/server/wm/WindowAnimator.java +++ b/services/java/com/android/server/wm/WindowAnimator.java @@ -13,6 +13,7 @@ import static com.android.server.wm.WindowManagerService.LayoutFields.SET_ORIENT import static com.android.server.wm.WindowManagerService.H.UPDATE_ANIM_PARAMETERS; import android.content.Context; +import android.os.Debug; import android.os.SystemClock; import android.util.Log; import android.util.Slog; @@ -203,9 +204,9 @@ public class WindowAnimator { if (mWallpaperTarget != layoutToAnim.mWallpaperTarget || mLowerWallpaperTarget != layoutToAnim.mLowerWallpaperTarget || mUpperWallpaperTarget != layoutToAnim.mUpperWallpaperTarget) { - Slog.d(TAG, "Updating anim wallpaper: target=" + mWallpaperTarget - + " lower=" + mLowerWallpaperTarget + " upper=" - + mUpperWallpaperTarget); + Slog.d(TAG, "Pulling anim wallpaper: target=" + layoutToAnim.mWallpaperTarget + + " lower=" + layoutToAnim.mLowerWallpaperTarget + " upper=" + + layoutToAnim.mUpperWallpaperTarget); } } mWallpaperTarget = layoutToAnim.mWallpaperTarget; @@ -259,11 +260,30 @@ public class WindowAnimator { } } - void hideWallpapersLocked(final WindowState w) { - if ((mWallpaperTarget == w && mLowerWallpaperTarget == null) || mWallpaperTarget == null) { - final int numTokens = mWallpaperTokens.size(); + void hideWallpapersLocked(final WindowState w, boolean fromAnimator) { + // There is an issue where this function can be called either from + // the animation or the layout side of the window manager. The problem + // is that if it is called from the layout side, we may not yet have + // propagated the current layout wallpaper state over into the animation + // state. If that is the case, we can do bad things like hide the + // wallpaper when we had just made it shown because the animation side + // doesn't yet see that there is now a wallpaper target. As a temporary + // work-around, we tell the function here which side of the window manager + // is calling so it can use the right state. + if (fromAnimator) { + hideWallpapersLocked(w, mWallpaperTarget, mLowerWallpaperTarget, mWallpaperTokens); + } else { + hideWallpapersLocked(w, mService.mWallpaperTarget, + mService.mLowerWallpaperTarget, mService.mWallpaperTokens); + } + } + + void hideWallpapersLocked(final WindowState w, final WindowState wallpaperTarget, + final WindowState lowerWallpaperTarget, final ArrayList<WindowToken> wallpaperTokens) { + if ((wallpaperTarget == w && lowerWallpaperTarget == null) || wallpaperTarget == null) { + final int numTokens = wallpaperTokens.size(); for (int i = numTokens - 1; i >= 0; i--) { - final WindowToken token = mWallpaperTokens.get(i); + final WindowToken token = wallpaperTokens.get(i); final int numWindows = token.windows.size(); for (int j = numWindows - 1; j >= 0; j--) { final WindowState wallpaper = token.windows.get(j); @@ -276,7 +296,9 @@ public class WindowAnimator { } } if (WindowManagerService.DEBUG_WALLPAPER_LIGHT && !token.hidden) Slog.d(TAG, - "Hiding wallpaper " + token + " from " + w); + "Hiding wallpaper " + token + " from " + w + + " target=" + wallpaperTarget + " lower=" + lowerWallpaperTarget + + "\n" + Debug.getCallers(5, " ")); token.hidden = true; } } diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 137c8ee..0659409 100755 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -192,7 +192,7 @@ public class WindowManagerService extends IWindowManager.Stub static final boolean DEBUG_STARTING_WINDOW = false; static final boolean DEBUG_REORDER = false; static final boolean DEBUG_WALLPAPER = false; - static final boolean DEBUG_WALLPAPER_LIGHT = true || DEBUG_WALLPAPER; + static final boolean DEBUG_WALLPAPER_LIGHT = false || DEBUG_WALLPAPER; static final boolean DEBUG_DRAG = false; static final boolean DEBUG_SCREEN_ON = false; static final boolean DEBUG_SCREENSHOT = false; @@ -545,7 +545,7 @@ public class WindowManagerService extends IWindowManager.Stub WindowState mWallpaperTarget = null; // If non-null, we are in the middle of animating from one wallpaper target // to another, and this is the lower one in Z-order. - private WindowState mLowerWallpaperTarget = null; + WindowState mLowerWallpaperTarget = null; // If non-null, we are in the middle of animating from one wallpaper target // to another, and this is the higher one in Z-order. private WindowState mUpperWallpaperTarget = null; @@ -1566,6 +1566,7 @@ public class WindowManagerService extends IWindowManager.Stub int adjustWallpaperWindowsLocked() { mInnerFields.mWallpaperMayChange = false; int changed = 0; + boolean targetChanged = false; // TODO(multidisplay): Wallpapers on main screen only. final DisplayInfo displayInfo = getDefaultDisplayContentLocked().getDisplayInfo(); @@ -1608,7 +1609,7 @@ public class WindowManagerService extends IWindowManager.Stub if ((w.mAttrs.flags&FLAG_SHOW_WALLPAPER) != 0 && w.isReadyForDisplay() && (mWallpaperTarget == w || w.isDrawnLw())) { if (DEBUG_WALLPAPER) Slog.v(TAG, - "Found wallpaper activity: #" + i + "=" + w); + "Found wallpaper target: #" + i + "=" + w); foundW = w; foundI = i; if (w == mWallpaperTarget && w.mWinAnimator.isAnimating()) { @@ -1665,6 +1666,7 @@ public class WindowManagerService extends IWindowManager.Stub WindowState oldW = mWallpaperTarget; mWallpaperTarget = foundW; + targetChanged = true; // Now what is happening... if the current and new targets are // animating, then we are in our super special mode! @@ -1738,6 +1740,8 @@ public class WindowManagerService extends IWindowManager.Stub } mLowerWallpaperTarget = null; mUpperWallpaperTarget = null; + mWallpaperTarget = foundW; + targetChanged = true; } } @@ -1872,6 +1876,12 @@ public class WindowManagerService extends IWindowManager.Stub } } + if (targetChanged && DEBUG_WALLPAPER_LIGHT) { + Slog.d(TAG, "New wallpaper: target=" + mWallpaperTarget + + " lower=" + mLowerWallpaperTarget + " upper=" + + mUpperWallpaperTarget); + } + return changed; } @@ -2847,7 +2857,7 @@ public class WindowManagerService extends IWindowManager.Stub } if ((attrChanges&WindowManager.LayoutParams.FORMAT_CHANGED) != 0) { // To change the format, we need to re-build the surface. - winAnimator.destroySurfaceLocked(); + winAnimator.destroySurfaceLocked(false); toBeDisplayed = true; surfaceChanged = true; } @@ -2928,7 +2938,7 @@ public class WindowManagerService extends IWindowManager.Stub if (mInputMethodWindow == win) { mInputMethodWindow = null; } - winAnimator.destroySurfaceLocked(); + winAnimator.destroySurfaceLocked(false); } scheduleNotifyWindowTranstionIfNeededLocked(win, transit); } @@ -3030,7 +3040,7 @@ public class WindowManagerService extends IWindowManager.Stub if (win == null) { return; } - win.mWinAnimator.destroyDeferredSurfaceLocked(); + win.mWinAnimator.destroyDeferredSurfaceLocked(false); } } finally { Binder.restoreCallingIdentity(origId); @@ -8136,7 +8146,7 @@ public class WindowManagerService extends IWindowManager.Stub pw.flush(); Slog.w(TAG, "This window was lost: " + ws); Slog.w(TAG, sw.toString()); - ws.mWinAnimator.destroySurfaceLocked(); + ws.mWinAnimator.destroySurfaceLocked(false); } } Slog.w(TAG, "Current app token list:"); @@ -9443,7 +9453,7 @@ public class WindowManagerService extends IWindowManager.Stub if (win == mWallpaperTarget) { wallpaperDestroyed = true; } - win.mWinAnimator.destroySurfaceLocked(); + win.mWinAnimator.destroySurfaceLocked(false); } while (i > 0); mDestroySurface.clear(); } @@ -9692,6 +9702,15 @@ public class WindowManagerService extends IWindowManager.Stub allWinAnimatorLists.put(displayContent.getDisplayId(), winAnimatorList); } + if (WindowManagerService.DEBUG_WALLPAPER_LIGHT) { + if (mWallpaperTarget != layoutToAnim.mWallpaperTarget + || mLowerWallpaperTarget != layoutToAnim.mLowerWallpaperTarget + || mUpperWallpaperTarget != layoutToAnim.mUpperWallpaperTarget) { + Slog.d(TAG, "Pushing anim wallpaper: target=" + mWallpaperTarget + + " lower=" + mLowerWallpaperTarget + " upper=" + + mUpperWallpaperTarget + "\n" + Debug.getCallers(5, " ")); + } + } layoutToAnim.mWallpaperTarget = mWallpaperTarget; layoutToAnim.mLowerWallpaperTarget = mLowerWallpaperTarget; layoutToAnim.mUpperWallpaperTarget = mUpperWallpaperTarget; @@ -10054,6 +10073,11 @@ public class WindowManagerService extends IWindowManager.Stub mInputMonitor.freezeInputDispatchingLw(); + // Clear the last input window -- that is just used for + // clean transitions between IMEs, and if we are freezing + // the screen then the whole world is changing behind the scenes. + mPolicy.setLastInputMethodWindowLw(null, null); + if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) { mNextAppTransition = WindowManagerPolicy.TRANSIT_UNSET; mNextAppTransitionType = ActivityOptions.ANIM_NONE; diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java index e1cc58f..35bebbe 100644 --- a/services/java/com/android/server/wm/WindowState.java +++ b/services/java/com/android/server/wm/WindowState.java @@ -875,8 +875,8 @@ final class WindowState implements WindowManagerPolicy.WindowState { if (WindowManagerService.DEBUG_ADD_REMOVE) Slog.v(TAG, "Removing " + this + " from " + mAttachedWindow); mAttachedWindow.mChildWindows.remove(this); } - mWinAnimator.destroyDeferredSurfaceLocked(); - mWinAnimator.destroySurfaceLocked(); + mWinAnimator.destroyDeferredSurfaceLocked(false); + mWinAnimator.destroySurfaceLocked(false); mSession.windowRemovedLocked(); try { mClient.asBinder().unlinkToDeath(mDeathRecipient, 0); diff --git a/services/java/com/android/server/wm/WindowStateAnimator.java b/services/java/com/android/server/wm/WindowStateAnimator.java index 85f087f..7b30c89 100644 --- a/services/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/java/com/android/server/wm/WindowStateAnimator.java @@ -225,7 +225,7 @@ class WindowStateAnimator { mAnimation.cancel(); mAnimation = null; mLocalAnimating = false; - destroySurfaceLocked(); + destroySurfaceLocked(true); } } @@ -412,7 +412,7 @@ class WindowStateAnimator { mService.mPendingRemove.add(mWin); mWin.mRemoveOnExit = false; } - mAnimator.hideWallpapersLocked(mWin); + mAnimator.hideWallpapersLocked(mWin, true); } void hide() { @@ -500,17 +500,21 @@ class WindowStateAnimator { @Override public void setAlpha(float alpha) { super.setAlpha(alpha); + if (alpha != mSurfaceTraceAlpha) { + Slog.v(SURFACE_TAG, "setAlpha: " + this + ". Called by " + + Debug.getCallers(3)); + } mSurfaceTraceAlpha = alpha; - Slog.v(SURFACE_TAG, "setAlpha: " + this + ". Called by " - + Debug.getCallers(3)); } @Override public void setLayer(int zorder) { super.setLayer(zorder); + if (zorder != mLayer) { + Slog.v(SURFACE_TAG, "setLayer: " + this + ". Called by " + + Debug.getCallers(3)); + } mLayer = zorder; - Slog.v(SURFACE_TAG, "setLayer: " + this + ". Called by " - + Debug.getCallers(3)); sSurfaces.remove(this); int i; @@ -526,49 +530,61 @@ class WindowStateAnimator { @Override public void setPosition(float x, float y) { super.setPosition(x, y); + if (x != mPosition.x || y != mPosition.y) { + Slog.v(SURFACE_TAG, "setPosition: " + this + ". Called by " + + Debug.getCallers(3)); + } mPosition.set(x, y); - Slog.v(SURFACE_TAG, "setPosition: " + this + ". Called by " - + Debug.getCallers(3)); } @Override public void setSize(int w, int h) { super.setSize(w, h); + if (w != mSize.x || h != mSize.y) { + Slog.v(SURFACE_TAG, "setSize: " + this + ". Called by " + + Debug.getCallers(3)); + } mSize.set(w, h); - Slog.v(SURFACE_TAG, "setSize: " + this + ". Called by " - + Debug.getCallers(3)); } @Override public void setWindowCrop(Rect crop) { super.setWindowCrop(crop); if (crop != null) { + if (!crop.equals(mWindowCrop)) { + Slog.v(SURFACE_TAG, "setWindowCrop: " + this + ". Called by " + + Debug.getCallers(3)); + } mWindowCrop.set(crop); } - Slog.v(SURFACE_TAG, "setWindowCrop: " + this + ". Called by " - + Debug.getCallers(3)); } @Override public void setLayerStack(int layerStack) { super.setLayerStack(layerStack); + if (layerStack != mLayerStack) { + Slog.v(SURFACE_TAG, "setLayerStack: " + this + ". Called by " + Debug.getCallers(3)); + } mLayerStack = layerStack; - Slog.v(SURFACE_TAG, "setLayerStack: " + this + ". Called by " + Debug.getCallers(3)); } @Override public void hide() { super.hide(); + if (mShown) { + Slog.v(SURFACE_TAG, "hide: " + this + ". Called by " + + Debug.getCallers(3)); + } mShown = false; - Slog.v(SURFACE_TAG, "hide: " + this + ". Called by " - + Debug.getCallers(3)); } @Override public void show() { super.show(); + if (!mShown) { + Slog.v(SURFACE_TAG, "show: " + this + ". Called by " + + Debug.getCallers(3)); + } mShown = true; - Slog.v(SURFACE_TAG, "show: " + this + ". Called by " - + Debug.getCallers(3)); } @Override @@ -728,7 +744,7 @@ class WindowStateAnimator { return mSurface; } - void destroySurfaceLocked() { + void destroySurfaceLocked(boolean fromAnimator) { if (mWin.mAppToken != null && mWin == mWin.mAppToken.startingWindow) { mWin.mAppToken.startingDisplayed = false; } @@ -778,7 +794,7 @@ class WindowStateAnimator { } mSurface.destroy(); } - mAnimator.hideWallpapersLocked(mWin); + mAnimator.hideWallpapersLocked(mWin, fromAnimator); } catch (RuntimeException e) { Slog.w(TAG, "Exception thrown when destroying Window " + this + " surface " + mSurface + " session " + mSession @@ -792,7 +808,7 @@ class WindowStateAnimator { } } - void destroyDeferredSurfaceLocked() { + void destroyDeferredSurfaceLocked(boolean fromAnimator) { try { if (mPendingDestroySurface != null) { if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) { @@ -804,7 +820,7 @@ class WindowStateAnimator { WindowManagerService.logSurface(mWin, "DESTROY PENDING", e); } mPendingDestroySurface.destroy(); - mAnimator.hideWallpapersLocked(mWin); + mAnimator.hideWallpapersLocked(mWin, fromAnimator); } } catch (RuntimeException e) { Slog.w(TAG, "Exception thrown when destroying Window " @@ -1192,7 +1208,7 @@ class WindowStateAnimator { hide(); } else if (w.mAttachedHidden || !w.isReadyForDisplay()) { hide(); - mAnimator.hideWallpapersLocked(w); + mAnimator.hideWallpapersLocked(w, true); // If we are waiting for this window to handle an // orientation change, well, it is hidden, so |
