summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Galia Peycheva <galinap@google.com> 2022-05-05 10:51:10 +0200
committer Galia Peycheva <galinap@google.com> 2022-05-05 18:11:09 +0200
commit557fc354c138b5b22dca865531dc087086a1e52c (patch)
tree112265e67bf07c33e2811d1b809f917e10a31753
parenta512a9b95584576d71bed77c34596d5267fcbf28 (diff)
Set TvBottomSheetActivity as unrestricted keep-clear area
This makes the Tv Pip move away from the dialog in order to not cover its content Bug: 227596282 Test: manual: start activity in Pip; start Duo and send: adb shell cmd sensor_privacy enable 0 microphone && \ adb shell appops start com.google.android.apps.tachyon 27 Change-Id: Ifb0a11cc6c09b2b088d8a28c6016b831f5c57ac9
-rw-r--r--data/etc/com.android.systemui.xml1
-rw-r--r--packages/SystemUI/AndroidManifest.xml2
-rw-r--r--packages/SystemUI/src/com/android/systemui/tv/TvBottomSheetActivity.java9
3 files changed, 12 insertions, 0 deletions
diff --git a/data/etc/com.android.systemui.xml b/data/etc/com.android.systemui.xml
index ebf5832147f7..f030d80a3533 100644
--- a/data/etc/com.android.systemui.xml
+++ b/data/etc/com.android.systemui.xml
@@ -80,5 +80,6 @@
<permission name="android.permission.READ_COMPAT_CHANGE_CONFIG" />
<permission name="android.permission.READ_DEVICE_CONFIG" />
<permission name="android.permission.READ_SAFETY_CENTER_STATUS" />
+ <permission name="android.permission.SET_UNRESTRICTED_KEEP_CLEAR_AREAS" />
</privapp-permissions>
</permissions>
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 290ce345694e..4d0888ab8d2d 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -323,6 +323,8 @@
<!-- To read safety center status -->
<uses-permission android:name="android.permission.READ_SAFETY_CENTER_STATUS" />
+ <uses-permission android:name="android.permission.SET_UNRESTRICTED_KEEP_CLEAR_AREAS" />
+
<protected-broadcast android:name="com.android.settingslib.action.REGISTER_SLICE_RECEIVER" />
<protected-broadcast android:name="com.android.settingslib.action.UNREGISTER_SLICE_RECEIVER" />
<protected-broadcast android:name="com.android.settings.flashlight.action.FLASHLIGHT_CHANGED" />
diff --git a/packages/SystemUI/src/com/android/systemui/tv/TvBottomSheetActivity.java b/packages/SystemUI/src/com/android/systemui/tv/TvBottomSheetActivity.java
index 2b7a33260248..90f24347d20d 100644
--- a/packages/SystemUI/src/com/android/systemui/tv/TvBottomSheetActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/tv/TvBottomSheetActivity.java
@@ -18,15 +18,18 @@ package com.android.systemui.tv;
import android.app.Activity;
import android.graphics.PixelFormat;
+import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Gravity;
+import android.view.View;
import android.view.WindowManager;
import com.android.systemui.R;
+import java.util.Collections;
import java.util.function.Consumer;
/**
@@ -75,6 +78,12 @@ public abstract class TvBottomSheetActivity extends Activity {
getWindow().setElevation(getWindow().getElevation() + 5);
getWindow().setBackgroundBlurRadius(getResources().getDimensionPixelSize(
R.dimen.bottom_sheet_background_blur_radius));
+
+ final View rootView = findViewById(R.id.bottom_sheet);
+ rootView.addOnLayoutChangeListener((view, l, t, r, b, oldL, oldT, oldR, oldB) -> {
+ rootView.setUnrestrictedPreferKeepClearRects(
+ Collections.singletonList(new Rect(0, 0, r - l, b - t)));
+ });
}
@Override