Merge cherrypicks of [9943992, 9944684, 9944054, 9943993, 9944476, 9942363, 9942364, 9942365, 9942367, 9944685, 9944686, 9943217, 9944762, 9944764, 9944481, 9944411, 9944055, 9944056, 9944057] into qt-qpr1-release
Change-Id: I0a3497e698296c02e5993bd503a594ac24028014
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 56ac884..df73092 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -9,6 +9,7 @@
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.MANAGE_USERS" />
<uses-permission android:name="android.permission.ACCESS_ALL_DOWNLOADS" />
+ <uses-permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS" />
<application android:label="@string/app_name"
android:allowBackup="false">
diff --git a/src/com/android/certinstaller/CertInstaller.java b/src/com/android/certinstaller/CertInstaller.java
index 8b381cb..dd849a7 100644
--- a/src/com/android/certinstaller/CertInstaller.java
+++ b/src/com/android/certinstaller/CertInstaller.java
@@ -16,6 +16,8 @@
package com.android.certinstaller;
+import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
+
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
@@ -85,6 +87,7 @@
@Override
protected void onCreate(Bundle savedStates) {
super.onCreate(savedStates);
+ getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
mCredentials = createCredentialHelper(getIntent());