From 068221bbba52ccf652e20f4a42037d9ee05a29c9 Mon Sep 17 00:00:00 2001 From: Eugene Susla Date: Mon, 26 Oct 2020 09:08:49 -0700 Subject: [PATCH] RESTRICT AUTOMERGE Prevent non-system overlays from showing over CDM UI Since CDM grants privileges, it should have the same overlay policy as permission UI Test: use an app wit ha visible overlay to ensure the overlay disappears when CDM is shown Fixes: 171221090 Change-Id: I4daaee7d8b710a72f6166cbb2252ef8af84c2c60 --- .../companiondevicemanager/DeviceChooserActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java index 16ef59f201f17..34139a8e58e9e 100644 --- a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java +++ b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java @@ -17,6 +17,7 @@ package com.android.companiondevicemanager; import static android.companion.BluetoothDeviceFilterUtils.getDeviceMacAddress; +import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; import android.app.Activity; import android.companion.CompanionDeviceManager; @@ -56,6 +57,8 @@ public class DeviceChooserActivity extends Activity { Log.e(LOG_TAG, "About to show UI, but no devices to show"); } + getWindow().addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); + if (getService().mRequest.isSingleDevice()) { setContentView(R.layout.device_confirmation); final DeviceFilterPair selectedDevice = getService().mDevicesFound.get(0); @@ -157,4 +160,4 @@ public class DeviceChooserActivity extends Activity { new Intent().putExtra(CompanionDeviceManager.EXTRA_DEVICE, selectedDevice.device)); finish(); } -} \ No newline at end of file +}