3333import android .content .res .CompatibilityInfo ;
3434import android .content .res .Configuration ;
3535import android .content .res .Resources ;
36+ import android .content .res .TypedArray ;
3637import android .database .ContentObserver ;
3738import android .graphics .PixelFormat ;
3839import android .graphics .Rect ;
@@ -1434,8 +1435,9 @@ public boolean canBeForceHidden(WindowState win, WindowManager.LayoutParams attr
14341435 && attrs .type != WindowManager .LayoutParams .TYPE_NAVIGATION_BAR
14351436 && attrs .type != WindowManager .LayoutParams .TYPE_WALLPAPER ;
14361437 }
1437-
1438+
14381439 /** {@inheritDoc} */
1440+ @ Override
14391441 public View addStartingWindow (IBinder appToken , String packageName , int theme ,
14401442 CompatibilityInfo compatInfo , CharSequence nonLocalizedLabel , int labelRes ,
14411443 int icon , int windowFlags ) {
@@ -1445,7 +1447,7 @@ public View addStartingWindow(IBinder appToken, String packageName, int theme,
14451447 if (packageName == null ) {
14461448 return null ;
14471449 }
1448-
1450+
14491451 try {
14501452 Context context = mContext ;
14511453 //Log.i(TAG, "addStartingWindow " + packageName + ": nonLocalizedLabel="
@@ -1458,16 +1460,19 @@ public View addStartingWindow(IBinder appToken, String packageName, int theme,
14581460 // Ignore
14591461 }
14601462 }
1461-
1463+
14621464 Window win = PolicyManager .makeNewWindow (context );
1463- if (win .getWindowStyle ().getBoolean (
1464- com .android .internal .R .styleable .Window_windowDisablePreview , false )) {
1465+ final TypedArray ta = win .getWindowStyle ();
1466+ if (ta .getBoolean (
1467+ com .android .internal .R .styleable .Window_windowDisablePreview , false )
1468+ || ta .getBoolean (
1469+ com .android .internal .R .styleable .Window_windowShowWallpaper ,false )) {
14651470 return null ;
14661471 }
1467-
1472+
14681473 Resources r = context .getResources ();
14691474 win .setTitle (r .getText (labelRes , nonLocalizedLabel ));
1470-
1475+
14711476 win .setType (
14721477 WindowManager .LayoutParams .TYPE_APPLICATION_STARTING );
14731478 // Force the window flags: this is a fake window, so it is not really
@@ -1483,14 +1488,14 @@ public View addStartingWindow(IBinder appToken, String packageName, int theme,
14831488 WindowManager .LayoutParams .FLAG_NOT_TOUCHABLE |
14841489 WindowManager .LayoutParams .FLAG_NOT_FOCUSABLE |
14851490 WindowManager .LayoutParams .FLAG_ALT_FOCUSABLE_IM );
1486-
1491+
14871492 if (!compatInfo .supportsScreen ()) {
14881493 win .addFlags (WindowManager .LayoutParams .FLAG_COMPATIBLE_WINDOW );
14891494 }
14901495
14911496 win .setLayout (WindowManager .LayoutParams .MATCH_PARENT ,
14921497 WindowManager .LayoutParams .MATCH_PARENT );
1493-
1498+
14941499 final WindowManager .LayoutParams params = win .getAttributes ();
14951500 params .token = appToken ;
14961501 params .packageName = packageName ;
@@ -1512,7 +1517,7 @@ public View addStartingWindow(IBinder appToken, String packageName, int theme,
15121517 // earlier.)
15131518 return null ;
15141519 }
1515-
1520+
15161521 if (localLOGV ) Log .v (
15171522 TAG , "Adding starting window for " + packageName
15181523 + " / " + appToken + ": "
0 commit comments