Loading services/core/java/com/android/server/wm/WindowManagerService.java +7 −4 Original line number Diff line number Diff line Loading @@ -428,7 +428,7 @@ public class WindowManagerService extends IWindowManager.Stub /** * Stores for each user whether screencapture is disabled * This array is essentially a cache for all userId for * {@link android.app.admin.DevicePolicyManager#getScreenCaptureDisabled(null, userId)} * {@link android.app.admin.DevicePolicyManager#getScreenCaptureDisabled} */ SparseArray<Boolean> mScreenCaptureDisabled = new SparseArray<Boolean>(); Loading Loading @@ -2315,9 +2315,12 @@ public class WindowManagerService extends IWindowManager.Stub return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } } else if (token.appWindowToken != null) { Slog.i(TAG, "Non-null appWindowToken for system window of type=" + type); // app token should be null for any other window types. token.appWindowToken = null; Slog.w(TAG, "Non-null appWindowToken for system window of type=" + type); // It is not valid to use an app token with other system types; we will // instead make a new token for it (as if null had been passed in for the token). attrs.token = null; token = new WindowToken(this, null, -1, false); addToken = true; } win = new WindowState(this, session, client, token, Loading tests/ActivityTests/AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" /> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" /> <uses-permission android:name="android.permission.MANAGE_USERS" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <application android:label="ActivityTest"> <activity android:name="ActivityTestMain"> <intent-filter> Loading tests/ActivityTests/src/com/google/android/test/activity/ActivityTestMain.java +7 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; import android.graphics.Bitmap; import android.view.WindowManager; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; Loading Loading @@ -130,6 +131,12 @@ public class ActivityTestMain extends Activity { mSecondUser = ui.id; } } /* AlertDialog ad = new AlertDialog.Builder(this).setTitle("title").setMessage("message").create(); ad.getWindow().getAttributes().type = WindowManager.LayoutParams.TYPE_SYSTEM_ERROR; ad.show(); */ } @Override Loading Loading
services/core/java/com/android/server/wm/WindowManagerService.java +7 −4 Original line number Diff line number Diff line Loading @@ -428,7 +428,7 @@ public class WindowManagerService extends IWindowManager.Stub /** * Stores for each user whether screencapture is disabled * This array is essentially a cache for all userId for * {@link android.app.admin.DevicePolicyManager#getScreenCaptureDisabled(null, userId)} * {@link android.app.admin.DevicePolicyManager#getScreenCaptureDisabled} */ SparseArray<Boolean> mScreenCaptureDisabled = new SparseArray<Boolean>(); Loading Loading @@ -2315,9 +2315,12 @@ public class WindowManagerService extends IWindowManager.Stub return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } } else if (token.appWindowToken != null) { Slog.i(TAG, "Non-null appWindowToken for system window of type=" + type); // app token should be null for any other window types. token.appWindowToken = null; Slog.w(TAG, "Non-null appWindowToken for system window of type=" + type); // It is not valid to use an app token with other system types; we will // instead make a new token for it (as if null had been passed in for the token). attrs.token = null; token = new WindowToken(this, null, -1, false); addToken = true; } win = new WindowState(this, session, client, token, Loading
tests/ActivityTests/AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" /> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" /> <uses-permission android:name="android.permission.MANAGE_USERS" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <application android:label="ActivityTest"> <activity android:name="ActivityTestMain"> <intent-filter> Loading
tests/ActivityTests/src/com/google/android/test/activity/ActivityTestMain.java +7 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; import android.graphics.Bitmap; import android.view.WindowManager; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; Loading Loading @@ -130,6 +131,12 @@ public class ActivityTestMain extends Activity { mSecondUser = ui.id; } } /* AlertDialog ad = new AlertDialog.Builder(this).setTitle("title").setMessage("message").create(); ad.getWindow().getAttributes().type = WindowManager.LayoutParams.TYPE_SYSTEM_ERROR; ad.show(); */ } @Override Loading