OSDN Git Service

Don't save secure surfaces.
authorWale Ogunwale <ogunwale@google.com>
Wed, 23 Mar 2016 20:16:41 +0000 (13:16 -0700)
committerWale Ogunwale <ogunwale@google.com>
Wed, 23 Mar 2016 20:16:41 +0000 (13:16 -0700)
We don't want to save secure surfaces since their content shouldn't
be shown while the app isn't on screen and content might leak
through during the transition animation with saved surface.

Bug: 19940527
Bug: 27747315
Change-Id: Ie664e1015845e05ec01572a9d9c3574173ac2f91

services/core/java/com/android/server/wm/WindowState.java

index 1695615..9c0d737 100644 (file)
@@ -71,6 +71,7 @@ import static android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD;
 import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
 import static android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
 import static android.view.WindowManager.LayoutParams.FLAG_SCALED;
+import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
 import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
 import static android.view.WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
 import static android.view.WindowManager.LayoutParams.LAST_SUB_WINDOW;
@@ -1883,6 +1884,13 @@ final class WindowState implements WindowManagerPolicy.WindowState {
     }
 
     private boolean shouldSaveSurface() {
+        if ((mAttrs.flags & FLAG_SECURE) != 0) {
+            // We don't save secure surfaces since their content shouldn't be shown while the app
+            // isn't on screen and content might leak through during the transition animation with
+            // saved surface.
+            return false;
+        }
+
         if (ActivityManager.isLowRamDeviceStatic()) {
             // Don't save surfaces on Svelte devices.
             return false;