Merge cherrypicks of [9944477, 9943994, 9944758, 9942366, 9942368, 9942369, 9942370, 9944687, 9944688, 9944778, 9943870, 9944765, 9944482, 9944412, 9944798, 9944799, 9944800] into qt-qpr1-c-release

Change-Id: I4cb361a932193a0bce1fddfcc996efb7d7e1da32
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());