OSDN Git Service

Prevent overlay drawing on top of Bluetooth discovery request dialog
authorJakub Pawlowski <jpawlowski@google.com>
Thu, 14 May 2020 00:15:26 +0000 (02:15 +0200)
committerAnis Assi <anisassi@google.com>
Tue, 30 Jun 2020 23:11:07 +0000 (16:11 -0700)
Bug: 155650356
Change-Id: I9cee6e5bb8cef77aa385d664fe0738db1496ef20
Merged-In: I9cee6e5bb8cef77aa385d664fe0738db1496ef20
(cherry picked from commit ac671004231fb2ceb85f3101995e22dcc52c8088)
(cherry picked from commit ba7f6d7d45776254791dea3b1f5d2acc0dc9b2dd)

src/com/android/settings/bluetooth/RequestPermissionActivity.java

index d2e2060..7bc5c07 100644 (file)
@@ -37,6 +37,8 @@ import com.android.settingslib.bluetooth.BluetoothDiscoverableTimeoutReceiver;
 import com.android.settingslib.bluetooth.LocalBluetoothAdapter;
 import com.android.settingslib.bluetooth.LocalBluetoothManager;
 
+import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
+
 /**
  * RequestPermissionActivity asks the user whether to enable discovery. This is
  * usually started by an application wanted to start bluetooth and or discovery
@@ -72,6 +74,8 @@ public class RequestPermissionActivity extends Activity implements
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
+        getWindow().addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
+
         setResult(Activity.RESULT_CANCELED);
 
         // Note: initializes mLocalAdapter and returns true on error