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: I004843edf5a156dc07fb961edf80272f5cb50163
(cherry picked from commit ea4ce4d48e)
Merged-In: I004843edf5a156dc07fb961edf80272f5cb50163
This commit is contained in:
Eugene Susla
2020-10-26 09:08:49 -07:00
committed by Sterling Huber
parent d2ae809765
commit d7f514abbe

View File

@@ -17,6 +17,7 @@
package com.android.companiondevicemanager;
import static android.companion.BluetoothDeviceFilterUtils.getDeviceMacAddress;
import static android.view.WindowManager.LayoutParams.SYSTEM_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().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
if (getService().mRequest.isSingleDevice()) {
setContentView(R.layout.device_confirmation);
final DeviceFilterPair selectedDevice = getService().mDevicesFound.get(0);