Merge changes from topic "cdm_overlay-qt-dev" into qt-dev

* changes:
  RESTRICT AUTOMERGE Allow CDM to hide overlays
  RESTRICT AUTOMERGE Prevent non-system overlays from showing over CDM UI
This commit is contained in:
TreeHugger Robot
2021-02-03 01:36:09 +00:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 0 deletions

View File

@@ -29,6 +29,7 @@
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS"/>
<application
android:allowClearUserData="true"

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);