Bläddra i källkod

Bring up the hole punch for GCA on L10

Cherry-pick the overlay resource to L10.

Bug: 230552025

Test: local build passed.
Change-Id: Idc0983536646928bc6d88a9f8f0d4db14b288b29
(cherry picked from commit b01989f3d740bf27fb5fed5f6f182b0cc04c8143)
Jason Chang 2 år sedan
förälder
incheckning
57f8a7bfb6

+ 22 - 0
lynx/overlay/frameworks/base/core/res/res/values/config.xml

@@ -44,6 +44,28 @@
          Must be in the range specified by minimum and maximum. -->
     <item name="config_screenBrightnessSettingDefaultFloat" format="float" type="dimen">0.17429718</item>
 
+    <!-- Whether the display cutout region of the main built-in display should be forced to
+        black in software (to avoid aliasing or emulate a cutout that is not physically existent).
+    -->
+    <bool name="config_fillMainBuiltInDisplayCutout">true</bool>
+
+    <!-- Display cutout configuration -->
+    <string translatable="false" name="config_mainBuiltInDisplayCutout">
+        M 507,66
+        a 33,33 0 1 0 66,0 33,33 0 1 0 -66,0
+        Z
+        @left
+    </string>
+
+    <string translatable="false" name="config_mainBuiltInDisplayCutoutRectApproximation">
+        M 480,0
+        h 145
+        v 118
+        h -145
+        Z
+        @left
+    </string>
+
     <!-- Array of light sensor LUX values to define our levels for auto backlight brightness support.
       The N entries of this array define N  1 zones as follows:
          Zone 0:        0 <= LUX < array[0]

+ 38 - 0
lynx/overlay/frameworks/base/core/res/res/values/dimens.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2022, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<resources>
+    <!-- Radius of the software rounded corners. -->
+    <dimen name="rounded_corner_radius">47px</dimen>
+    <dimen name="rounded_corner_radius_top">47px</dimen>
+    <dimen name="rounded_corner_radius_bottom">48px</dimen>
+
+   <!-- for 20dp of padding at 3.5px/dp at default density -->
+    <dimen name="rounded_corner_content_padding">47px</dimen>
+
+    <!-- Height of the status bar.
+         Do not read this dimen directly. Use {@link SystemBarUtils#getStatusBarHeight} instead.
+         -->
+    <dimen name="status_bar_height_default">28dp</dimen>
+    <dimen name="status_bar_height_portrait">118px</dimen>
+    <dimen name="status_bar_height_landscape">28dp</dimen>
+
+    <!-- Adjustment for software rounded corners since corners aren't perfectly round. -->
+    <dimen name="rounded_corner_radius_adjustment">5px</dimen>
+</resources>

+ 25 - 0
lynx/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded_corner_bottom.xml

@@ -0,0 +1,25 @@
+<!--
+    Copyright (C) 2022 The Android Open Source Project
+
+    You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="50px"
+        android:height="50px"
+        android:viewportWidth="50"
+        android:viewportHeight="50">
+
+    <path
+        android:pathData="M 0,50 C 0.08303658,43.995271 0.26956077,42.271707 0.70414831,39.50341 1.0543654,37.272548 1.7782723,33.526779 4.1147257,27.960543 5.8269831,24.129607 7.6089696,21.336234 10.012571,18.172837 12.157673,15.498951 14.679237,12.871136 17.460579,10.600699 19.822417,8.7039434 22.788037,6.5492946 27.306398,4.4110174 30.772226,2.7708429 33.051046,2.0752882 37.181125,1.116566 41.654462,0.19593655 43.840716,0.0930927 50,0 H 0 Z"
+        android:fillColor="#000000" />
+
+</vector>
+

+ 25 - 0
lynx/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded_corner_top.xml

@@ -0,0 +1,25 @@
+<!--
+    Copyright (C) 2022 The Android Open Source Project
+
+    You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="50px"
+        android:height="50px"
+        android:viewportWidth="50"
+        android:viewportHeight="50">
+
+    <path
+        android:pathData="M 0,50 C 0.09060685,43.961677 0.29312289,41.906213 0.90627324,38.938969 1.4214352,36.445923 1.8152288,33.956753 4.3522215,28.156341 6.0942093,24.386105 7.8938533,21.486328 10.374474,18.316668 12.519576,15.642782 14.896031,13.143223 17.677373,10.872786 20.050666,9.0484831 22.757616,6.7720455 27.52968,4.6936421 31.552671,2.941486 32.881983,2.4984814 36.839765,1.44829 40.383179,0.67047466 42.768284,0.20918885 50,0 H 0 Z"
+        android:fillColor="#000000" />
+
+</vector>
+

+ 21 - 0
lynx/overlay/frameworks/base/packages/SystemUI/res/values-h800dp/dimens.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (c) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+-->
+<resources>
+    <!-- With the large clock, move up slightly from the center to avoid UDFPS -->
+    <dimen name="keyguard_large_clock_top_margin">-156dp</dimen>
+</resources>

+ 25 - 0
lynx/overlay/frameworks/base/packages/SystemUI/res/values-land/dimen.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (c) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+-->
+<resources>
+    <!-- Landscape, just use the regular values -->
+    <dimen name="status_bar_padding_start">8dp</dimen>
+    <dimen name="status_bar_padding_end">8dp</dimen>
+
+    <!-- the padding on the top of the statusbar (usually 0) -->
+    <dimen name="status_bar_padding_top">0dp</dimen>
+</resources>

+ 85 - 0
lynx/overlay/frameworks/base/packages/SystemUI/res/values/config.xml

@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2022, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- These resources are around just to allow their values to be customized
+     for different hardware and product builds. -->
+<resources>
+    <!-- Type of a sensor that provides a low-power estimate of the desired display
+         brightness, suitable to listen to while the device is asleep (e.g. during
+         always-on display) -->
+    <string name="doze_brightness_sensor_type" translatable="false">com.google.sensor.binned_brightness</string>
+
+    <!-- Doze: can we assume the pickup sensor includes a proximity check? -->
+    <bool name="doze_pickup_performs_proximity_check">true</bool>
+
+    <!-- Doze: whether the double tap sensor reports 2D touch coordinates -->
+    <bool name="doze_double_tap_reports_touch_coordinates">true</bool>
+
+    <!-- Doze: Table that translates sensor values from the doze_brightness_sensor_type sensor
+               to brightness values; -1 means keeping the current brightness. -->
+    <integer-array name="config_doze_brightness_sensor_to_brightness">
+        <item>-1</item> <!-- 0: OFF -->
+        <item>3</item> <!-- 1: NIGHT -->
+        <item>3</item> <!-- 2: LOW -->
+        <item>16</item> <!-- 3: HIGH -->
+        <item>16</item> <!-- 4: SUN -->
+    </integer-array>
+
+    <!-- Doze: Table that translates sensor values from the doze_brightness_sensor_type sensor
+               to an opacity value for a black scrim that is overlaid in AOD1.
+               Valid range is from 0 (transparent) to 255 (opaque).
+               -1 means keeping the current opacity. -->
+    <integer-array name="config_doze_brightness_sensor_to_scrim_opacity">
+        <item>-1</item> <!-- 0: OFF -->
+        <item>133</item> <!-- 1: NIGHT -->
+        <item>0</item> <!-- 2: LOW -->
+        <item>0</item> <!-- 3: HIGH -->
+        <item>0</item> <!-- 4: SUN -->
+    </integer-array>
+
+    <string name="proximity_sensor_type" translatable="false"></string>
+    <item name="proximity_sensor_threshold" translatable="false" format="float" type="dimen"></item>
+    <item name="proximity_sensor_threshold_latch" translatable="false" format="float" type="dimen"></item>
+    <string name="proximity_sensor_secondary_type" translatable="false"></string>
+    <item name="proximity_sensor_secondary_threshold" translatable="false" format="float" type="dimen"></item>
+
+    <!-- Default rounded corner curve (a Bezier). Must match (the curved path in) rounded.xml.
+         Note that while rounded.xml includes the entire path (including the horizontal and vertical
+         corner edges), this pulls out just the curve.
+     -->
+    <string name="config_rounded_mask" translatable="false">M 71,0 C 33,0 22,-1 10,10 -1,22 0,33 0,71</string>
+
+    <!-- Configure 13px of extra protection around the front-facing camera -->
+    <string translatable="false" name="config_frontBuiltInDisplayCutoutProtection">
+        M 494,66
+        a 46,46 0 1 0 92,0
+        a 46,46 0 1 0 -92,0
+        Z
+    </string>
+
+    <!-- Camera 1 is the front camera on barbet -->
+    <string translatable="false" name="config_protectedCameraId">1</string>
+
+    <!-- Comma-separated list of packages to exclude from camera protection. In our case,
+    ignore the gaze detection package -->
+    <string translatable="false" name="config_cameraProtectionExcludedPackages">com.google.android.as</string>
+
+    <bool name="config_enableDisplayCutoutProtection">true</bool>
+</resources>
+

+ 50 - 0
lynx/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml

@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (c) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+-->
+<resources>
+    <!-- Don't need the left side padding due to being inset from the cutout -->
+    <dimen name="status_bar_padding_start">0dp</dimen>
+
+    <!-- the padding on the top of the statusbar (usually 0) -->
+    <dimen name="status_bar_padding_top">1px</dimen>
+
+    <!-- Height of the status bar header bar when on Keyguard (match status_bar_height) -->
+    <dimen name="status_bar_header_height_keyguard">@*android:dimen/status_bar_height</dimen>
+
+    <!-- Padding for the system icons on the keyguard (when no multi user switch is showing).
+    The icons always have a 4dp padding in the container so we only need 56 extra px of padding
+    for the corners -->
+    <dimen name="system_icons_super_container_avatarless_margin_end">11px</dimen>
+
+    <!-- Multi user switch has some intrinsic padding to it -->
+    <dimen name="multi_user_switch_keyguard_margin">6dp</dimen>
+
+    <dimen name="keyguard_carrier_text_margin">0px</dimen>
+
+    <dimen name="config_rounded_mask_size">47px</dimen>
+    <dimen name="config_rounded_mask_size_top">47px</dimen>
+    <dimen name="config_rounded_mask_size_bottom">46px</dimen>
+
+    <!-- Location on the screen of the center of the physical power button. -->
+    <dimen name="physical_power_button_center_screen_location_y">650px</dimen>
+
+    <!-- Location on the screen of the center of the physical volume up/down buttons. -->
+    <dimen name="physical_volume_up_button_center_screen_location_y">950px</dimen>
+    <dimen name="physical_volume_down_button_center_screen_location_y">1110px</dimen>
+
+  </resources>
+