Merge "Update rounded corner, cutout and display shape configs" into main

This commit is contained in:
Kimi Hsu 2024-03-21 02:42:07 +00:00 committed by Android (Google) Code Review
commit 9fb19253e9
4 changed files with 88 additions and 3 deletions

View file

@ -251,8 +251,40 @@
<!-- The stable device width and height in pixels. If these aren't set to a positive number
then the device will use the width and height of the default display the first time it's
booted. -->
<integer name="config_stableDeviceDisplayWidth">1280</integer>
<integer name="config_stableDeviceDisplayHeight">2856</integer>
<integer name="config_stableDeviceDisplayWidth">1080</integer>
<integer name="config_stableDeviceDisplayHeight">2424</integer>
<!-- Radius of the software rounded corners. -->
<dimen name="rounded_corner_radius">115px</dimen>
<dimen name="rounded_corner_radius_top">115px</dimen>
<dimen name="rounded_corner_radius_bottom">115px</dimen>
<!-- 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 581.5,86 a 41.5,41.5 0 0 0 -83,0 41.5,41.5 0 0 0 83,0 z
@left
</string>
<string translatable="false" name="config_mainBuiltInDisplayCutoutRectApproximation">
m 484,0 h 112 v 152 h -112 z
@left
</string>
<!-- A string config in svg path format for the main display shape.
(@see https://www.w3.org/TR/SVG/paths.html#PathData).
This config must be set unless:
1. {@link Configuration#isScreenRound} is true which means the display shape is circular
and the system will auto-generate a circular shape.
2. The display has no rounded corner and the system will auto-generate a rectangular shape.
(@see DisplayShape#createDefaultDisplayShape)
Note: If the display supports multiple resolutions, please define the path config based on
the highest resolution so that it can be scaled correctly in each resolution. -->
<string name="config_mainDisplayShape">m 1079.5841,2228.3564 -0.1246,32.4289 -1.5262,29.5631 -5.2262,28.9368 -10.8184,28.1101 -17.0908,25.6679 -22.6755,21.2294 -24.9734,14.6141 -26.74845,9.0516 -27.32405,4.2923 -27.96102,1.2343 -30.67581,0.1 M 0.41700514,195.64292 0.54157654,163.21407 2.0678255,133.65079 7.2939781,104.71395 18.112341,76.603825 35.203139,50.936003 57.878707,29.706783 82.852085,15.092599 109.60055,6.040851 136.92456,1.7486483 164.88562,0.51443083 195.56143,0.41555729 m 688.87872,-2.2971e-4 32.41493,0.12395786 29.55063,1.52698566 28.92444,5.2283442 28.09805,10.8230047 25.6569,17.098154 21.22,22.685256 14.6081,24.984081 9.0478,26.759919 4.2904,27.33577 1.2336,27.97298 0.1,30.68899 M 195.56094,2423.584 l -32.41494,-0.1164 -29.55061,-1.527 -28.92444,-5.2283 -28.098077,-10.8231 -25.656844,-17.0981 -21.220125,-22.6853 -14.607925,-24.984 -9.0478703,-26.7598 -4.2903556,-27.3359 -1.23375522,-27.9729 -0.0996571,-30.689 m -0.001013,-0.01 V 195.6426 m 1079.16927242,0 V 2228.3577 M 884.44235,2423.5838 H 195.56204 m 0,-2423.16715466 h 688.88031 z</string>
<!-- The max vibration strength allowed in audio haptic channels. -->
<item name="config_hapticChannelMaxVibrationAmplitude" format="float" type="dimen">0.32</item>

View file

@ -0,0 +1,23 @@
<!--
Copyright (C) 2021 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="196.2px"
android:height="196.2px"
android:viewportWidth="196.2"
android:viewportHeight="196.2">
<path
android:fillColor="#000000"
android:pathData="m 0.05,195.2 c 0,0 -0.17,-21.62 0.12,-32.43 0.27,-9.86 0.39,-19.76 1.53,-29.56 1.13,-9.74 2.58,-19.5 5.23,-28.93 C 10.18,94.67 13.68,85.14 18.29,76.23 23.02,67.1 28.74,58.4 35.38,50.56 42.07,42.66 49.76,35.52 58.05,29.33 65.78,23.56 74.25,18.72 83.02,14.72 c 8.56,-3.91 17.6,-6.8 26.74,-9.05 8.95,-2.2 18.15,-3.37 27.32,-4.29 9.28,-0.93 18.63,-1.01 27.96,-1.23 10.22,-0.24 30.67,-0.1 30.67,-0.1 H 0.05 V 195.7 Z" />
</vector>

View file

@ -0,0 +1,23 @@
<!--
Copyright (C) 2021 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="196.2px"
android:height="196.2px"
android:viewportWidth="196.2"
android:viewportHeight="196.2">
<path
android:fillColor="#000000"
android:pathData="m 0.05,195.2 c 0,0 -0.17,-21.62 0.12,-32.43 0.27,-9.86 0.39,-19.76 1.53,-29.56 1.13,-9.74 2.58,-19.5 5.23,-28.93 C 10.18,94.67 13.68,85.14 18.29,76.23 23.02,67.1 28.74,58.4 35.38,50.56 42.07,42.66 49.76,35.52 58.05,29.33 65.78,23.56 74.25,18.72 83.02,14.72 c 8.56,-3.91 17.6,-6.8 26.74,-9.05 8.95,-2.2 18.15,-3.37 27.32,-4.29 9.28,-0.93 18.63,-1.01 27.96,-1.23 10.22,-0.24 30.67,-0.1 30.67,-0.1 H 0.05 V 195.7 Z" />
</vector>

View file

@ -22,7 +22,7 @@
<resources>
<!-- Configure 13px of extra protection around the front-facing camera -->
<string translatable="false" name="config_frontBuiltInDisplayCutoutProtection">
m 585.74,68.4 a 49.16,60.6 0 0 0 -91.47,0 49.16,60.6 0 0 0 91.47,0 Z
m 594.5,86 a 54.5,54.5 0 0 0 -109,0 54.5,54.5 0 0 0 109,0 z
</string>
<!-- Camera 1 is the front camera -->
@ -34,6 +34,13 @@
<bool name="config_enableDisplayCutoutProtection">true</bool>
<!-- The properties of the face auth front camera in pixels -->
<integer-array name="config_face_auth_props">
<item>540</item> <!-- sensorLocationX -->
<item>86</item> <!-- sensorLocationY -->
<item>54</item> <!--sensorRadius -->
</integer-array>
<!-- 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) -->