OSDN Git Service

RESTRICT AUTOMERGE am: b81f269ae2 am: db965097eb
[android-x86/frameworks-base.git] / services / core / java / com / android / server / wm / DisplayPolicy.java
index 99a9db3..2d835d3 100644 (file)
@@ -865,6 +865,8 @@ public class DisplayPolicy {
                 if (canToastShowWhenLocked(callingPid)) {
                     attrs.flags |= WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
                 }
+                // Toasts can't be clickable
+                attrs.flags |= WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
                 break;
         }
 
@@ -2812,7 +2814,11 @@ public class DisplayPolicy {
         mHandler.post(() -> {
             final int displayId = getDisplayId();
             getStatusBarManagerInternal().onDisplayReady(displayId);
-            LocalServices.getService(WallpaperManagerInternal.class).onDisplayReady(displayId);
+            final WallpaperManagerInternal wpMgr = LocalServices
+                    .getService(WallpaperManagerInternal.class);
+            if (wpMgr != null) {
+                wpMgr.onDisplayReady(displayId);
+            }
         });
     }