summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-09-22 23:22:26 (GMT)
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-09-22 23:22:26 (GMT)
commit0e5ada496fa3c692133afb54af7d690a2f767626 (patch)
treecb6e25b60fc0e4429bfeafa536d278015e8b95fa
parent773bffe3a5acd9f4cfcb0bd7d504329e9df6ac66 (diff)
parentba4bda41a83d78318553bb792d68d0a4c729fe15 (diff)
downloadandroid_packages_apps_PackageInstaller-lineage-15.0.zip
android_packages_apps_PackageInstaller-lineage-15.0.tar.gz
android_packages_apps_PackageInstaller-lineage-15.0.tar.bz2
Merge cherrypicks of [2947251, 2947338, 2947252, 2947253, 2946095, 2946096, 2946097, 2946098, 2947211, 2947212, 2947254, 2947255, 2947256, 2947257, 2947258, 2947349, 2947350, 2947351, 2947352, 2947353, 2946976, 2946977, 2946978, 2946979, 2946980, 2947354, 2947355, 2947435, 2947356, 2947357, 2947358, 2947359, 2947360, 2947418, 2947421, 2947422, 2947306] into oc-r3-releaselineage-15.0
Change-Id: Ia3f12e54646efc8255fe96023abbc122264aa26d
-rw-r--r--AndroidManifest.xml1
-rw-r--r--src/com/android/packageinstaller/permission/ui/OverlayTouchActivity.java31
2 files changed, 7 insertions, 25 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index a43cb06..f939175 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -21,6 +21,7 @@
<uses-permission android:name="android.permission.KILL_UID" />
<uses-permission android:name="android.permission.MANAGE_APP_OPS_RESTRICTIONS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
+ <uses-permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS" />
<uses-permission android:name="com.google.android.permission.INSTALL_WEARABLE_PACKAGES" />
diff --git a/src/com/android/packageinstaller/permission/ui/OverlayTouchActivity.java b/src/com/android/packageinstaller/permission/ui/OverlayTouchActivity.java
index a7800ca..5e1e146 100644
--- a/src/com/android/packageinstaller/permission/ui/OverlayTouchActivity.java
+++ b/src/com/android/packageinstaller/permission/ui/OverlayTouchActivity.java
@@ -15,33 +15,14 @@
*/
package com.android.packageinstaller.permission.ui;
+import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
+
import android.app.Activity;
-import android.app.AppOpsManager;
-import android.os.Binder;
-import android.os.IBinder;
+import android.os.Bundle;
public class OverlayTouchActivity extends Activity {
- private final IBinder mToken = new Binder();
-
- @Override
- protected void onResume() {
- super.onResume();
- setOverlayAllowed(false);
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- setOverlayAllowed(true);
- }
-
- private void setOverlayAllowed(boolean allowed) {
- AppOpsManager appOpsManager = getSystemService(AppOpsManager.class);
- if (appOpsManager != null) {
- appOpsManager.setUserRestriction(AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
- !allowed, mToken);
- appOpsManager.setUserRestriction(AppOpsManager.OP_TOAST_WINDOW,
- !allowed, mToken);
- }
+ protected void onCreate(Bundle savedInstanceState) {
+ getWindow().addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
+ super.onCreate(savedInstanceState);
}
}