OSDN Git Service

Merge "Clean up surfaces when app is resumed without being stopped." into nyc-mr1-dev
authorChong Zhang <chz@google.com>
Fri, 22 Jul 2016 17:07:44 +0000 (17:07 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Fri, 22 Jul 2016 17:07:45 +0000 (17:07 +0000)
1  2 
services/core/java/com/android/server/wm/WindowManagerService.java

@@@ -4476,7 -4476,25 +4476,25 @@@ public class WindowManagerService exten
      }
  
      @Override
-     public void notifyAppStopped(IBinder token, boolean stopped) {
+     public void notifyAppResumed(IBinder token, boolean wasStopped) {
+         if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
+                 "notifyAppResumed()")) {
+             throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
+         }
+         synchronized(mWindowMap) {
+             final AppWindowToken wtoken;
+             wtoken = findAppWindowToken(token);
+             if (wtoken == null) {
+                 Slog.w(TAG_WM, "Attempted to notify resumed of non-existing app token: " + token);
+                 return;
+             }
+             wtoken.notifyAppResumed(wasStopped);
+         }
+     }
+     @Override
+     public void notifyAppStopped(IBinder token) {
          if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
                  "notifyAppStopped()")) {
              throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
              final AppWindowToken wtoken;
              wtoken = findAppWindowToken(token);
              if (wtoken == null) {
-                 Slog.w(TAG_WM, "Attempted to set visibility of non-existing app token: " + token);
+                 Slog.w(TAG_WM, "Attempted to notify stopped of non-existing app token: " + token);
                  return;
              }
-             wtoken.notifyAppStopped(stopped);
+             wtoken.notifyAppStopped();
          }
      }
  
              if (task != null && task.mStack.getBoundsAnimating()) {
                  return;
              }
 -            w.setInsetsChanged();
 +            w.setReportResizeHints();
              boolean configChanged = w.isConfigChanged();
              if (DEBUG_CONFIGURATION && configChanged) {
                  Slog.v(TAG_WM, "Win " + w + " config changed: "
                      + ": configChanged=" + configChanged
                      + " dragResizingChanged=" + dragResizingChanged
                      + " last=" + w.mLastFrame + " frame=" + w.mFrame);
 -            w.mLastFrame.set(w.mFrame);
              if (w.mContentInsetsChanged
                      || w.mVisibleInsetsChanged
                      || winAnimator.mSurfaceResized
                      || w.mOutsetsChanged
 +                    || w.mFrameSizeChanged
                      || configChanged
                      || dragResizingChanged
                      || !w.isResizedWhileNotDragResizingReported()) {
                  w.mLastVisibleInsets.set(w.mVisibleInsets);
                  w.mLastStableInsets.set(w.mStableInsets);
                  w.mLastOutsets.set(w.mOutsets);
 +                w.mLastFrame.set(w.mFrame);
                  makeWindowFreezingScreenIfNeededLocked(w);
                  // If the orientation is changing, or we're starting or ending
                  // a drag resizing action, then we need to hold off on unfreezing