Merge "Updated some internal apps to use TYPE_APPLICATION_OVERLAY"

This commit is contained in:
TreeHugger Robot
2017-02-22 20:53:28 +00:00
committed by Android (Google) Code Review
4 changed files with 5 additions and 5 deletions

View File

@@ -1795,7 +1795,7 @@
<eat-comment />
<!-- Allows an app to create windows using the type
{@link android.view.WindowManager.LayoutParams#TYPE_SYSTEM_ALERT},
{@link android.view.WindowManager.LayoutParams#TYPE_APPLICATION_OVERLAY},
shown on top of all other apps. Very few apps
should use this permission; these windows are intended for
system-level interaction with the user.

View File

@@ -79,7 +79,7 @@ public class CaptivePortalLaunchActivity extends Activity {
private void showConnectingProgressDialog() {
mProgressDialog = new ProgressDialog(getApplicationContext());
mProgressDialog.setMessage(getString(R.string.progress_dialogue_network_connection));
mProgressDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
mProgressDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
mProgressDialog.show();
}

View File

@@ -108,14 +108,14 @@ public class FakeApp extends Application {
builder.setCancelable(false);
builder.setPositiveButton("I understand", null);
Dialog dialog = builder.create();
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
dialog.show();
}
// Make a fake window that is always around eating graphics resources.
FakeView view = new FakeView(this);
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,
WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);

View File

@@ -74,7 +74,7 @@ public class FakeBackgroundService extends Service {
// Make a fake window that is always around eating graphics resources.
FakeView view = new FakeView(this);
Dialog dialog = new Dialog(this, android.R.style.Theme_Holo_Dialog);
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
dialog.getWindow().setFlags(
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE