From 9cbc2c3d36d35afc152373443078324b94162d13 Mon Sep 17 00:00:00 2001 From: Eugene Susla Date: Mon, 26 Oct 2020 09:08:49 -0700 Subject: [PATCH 1/2] 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 7e23ee152ed94..18cec01dadf05 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; @@ -55,6 +56,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); @@ -155,4 +158,4 @@ public class DeviceChooserActivity extends Activity { new Intent().putExtra(CompanionDeviceManager.EXTRA_DEVICE, selectedDevice.device)); finish(); } -} \ No newline at end of file +} From 6a5777dd5020378507b97511925a0369f8f408b4 Mon Sep 17 00:00:00 2001 From: Eugene Susla Date: Fri, 4 Dec 2020 16:01:46 -0800 Subject: [PATCH 2/2] RESTRICT AUTOMERGE Allow CDM to hide overlays Since CDM has sensitive user consent UIs, it should be able to hide non-system overlays Test: use a 3p overlay app with a visible overlay to ensure overlay disappears when CDM is shown Bug: 171221090 Change-Id: I3274cb7f03f63e1fa99a9ca06759972ce2a51309 --- packages/CompanionDeviceManager/AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/CompanionDeviceManager/AndroidManifest.xml b/packages/CompanionDeviceManager/AndroidManifest.xml index 34bc4ebcd0aa2..2224dfc6a81ba 100644 --- a/packages/CompanionDeviceManager/AndroidManifest.xml +++ b/packages/CompanionDeviceManager/AndroidManifest.xml @@ -28,6 +28,7 @@ +