summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Shao <johnshao@google.com>2020-12-23 22:21:30 +0000
committermosimchah <mosimchah@gmail.com>2021-04-13 02:30:52 -0400
commit927f74866fbc303201ff14dbc8f5e1df02d272a6 (patch)
tree2c1ff57c501b009e369592ea62d87c52015ac9d9
parentf7e629a0fceea449b615f80d42129594ea466ab7 (diff)
Prevent overlays on vCard import flowsq10.0
Bug: 172252122 Test: manual with POC Change-Id: I69c46f073f324005c3dd214447792fc20fe75a2b Merged-In: I69c46f073f324005c3dd214447792fc20fe75a2b (cherry picked from commit aa189a0daadf4d4cd8e00895c9bdbb8ac0ec9bb6) (cherry picked from commit b423fdf941a10fc1498dcee0665e56fb1856bf4e)
-rw-r--r--Android.mk2
-rw-r--r--AndroidManifest.xml1
-rw-r--r--src/com/android/contacts/vcard/ImportVCardActivity.java3
-rw-r--r--src/com/android/contacts/vcard/SelectAccountActivity.java3
4 files changed, 8 insertions, 1 deletions
diff --git a/Android.mk b/Android.mk
index 2a3a4857b..561546a82 100644
--- a/Android.mk
+++ b/Android.mk
@@ -43,7 +43,7 @@ LOCAL_REQUIRED_MODULES := privapp_whitelist_com.android.contacts
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
-LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := system_current
LOCAL_MIN_SDK_VERSION := 21
include $(BUILD_PACKAGE)
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 8494865b4..eb5496c4e 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -53,6 +53,7 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<!-- Required in P to run Service.startForeground() -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
+ <uses-permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS" />
<uses-feature
android:name="android.hardware.telephony"
diff --git a/src/com/android/contacts/vcard/ImportVCardActivity.java b/src/com/android/contacts/vcard/ImportVCardActivity.java
index 2c69cdfd6..38367c40f 100644
--- a/src/com/android/contacts/vcard/ImportVCardActivity.java
+++ b/src/com/android/contacts/vcard/ImportVCardActivity.java
@@ -546,6 +546,9 @@ public class ImportVCardActivity extends Activity implements ImportVCardDialogFr
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
+ getWindow().addSystemFlags(android.view.WindowManager.LayoutParams
+ .SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
+
Uri sourceUri = getIntent().getData();
// Reading uris from non-storage needs the permission granted from the source intent,
diff --git a/src/com/android/contacts/vcard/SelectAccountActivity.java b/src/com/android/contacts/vcard/SelectAccountActivity.java
index ac5b3eb71..eb13e505c 100644
--- a/src/com/android/contacts/vcard/SelectAccountActivity.java
+++ b/src/com/android/contacts/vcard/SelectAccountActivity.java
@@ -52,6 +52,9 @@ public class SelectAccountActivity extends Activity {
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
+ getWindow().addSystemFlags(android.view.WindowManager.LayoutParams
+ .SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
+
// There's three possibilities:
// - more than one accounts -> ask the user
// - just one account -> use the account without asking the user