Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6549458 authored by Bill Lin's avatar Bill Lin
Browse files

Add Overlay package for simulate punch hole cutout(1/N)

Test: adb shell cmd overlay enable --user 0 com.android.internal.display.cutout.emulation.hole
Test: atest DisplayCutoutTests
Bug: 145707162
Change-Id: I5669377a86c003b7bd52d9a9bfa79771209e0e8c
parent 843cd473
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ LOCAL_REQUIRED_MODULES := \
	AccentColorPurpleOverlay \
	DisplayCutoutEmulationCornerOverlay \
	DisplayCutoutEmulationDoubleOverlay \
        DisplayCutoutEmulationHoleOverlay \
	DisplayCutoutEmulationTallOverlay \
	FontNotoSerifSourceOverlay \
	IconPackCircularAndroidOverlay \
+14 −0
Original line number Diff line number Diff line
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_RRO_THEME := DisplayCutoutEmulationHole


LOCAL_PRODUCT_MODULE := true

LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res

LOCAL_PACKAGE_NAME := DisplayCutoutEmulationHoleOverlay
LOCAL_SDK_VERSION := current

include $(BUILD_RRO_PACKAGE)
+26 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2020 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.
  -->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.android.internal.display.cutout.emulation.hole"
        android:versionCode="1"
        android:versionName="1.0">
    <overlay android:targetPackage="android"
            android:category="com.android.internal.display_cutout_emulation"
            android:priority="1"/>

    <application android:label="@string/display_cutout_emulation_overlay" android:hasCode="false"/>
</manifest>
+22 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2020 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>
    <!-- Can't link to other dimensions here, but this should be status_bar_height_landscape -->
    <dimen name="quick_qs_offset_height">28dp</dimen>
    <!-- Total height of QQS in landscape; quick_qs_offset_height + 128 -->
    <dimen name="quick_qs_total_height">156dp</dimen>
</resources>
+61 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2020 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

    <!-- The bounding path of the cutout region of the main built-in display.
         Must either be empty if there is no cutout region, or a string that is parsable by
         {@link android.util.PathParser}.

         The path is assumed to be specified in display coordinates with pixel units and in
         the display's native orientation, with the origin of the coordinate system at the
         center top of the display.

         To facilitate writing device-independent emulation overlays, the marker `@dp` can be
         appended after the path string to interpret coordinates in dp instead of px units.
         Note that a physical cutout should be configured in pixels for the best results.
         -->
    <!-- Display cutout configuration -->
    <string translatable="false" name="config_mainBuiltInDisplayCutout">
        M 128,83 A 44,44 0 0 1 84,127 44,44 0 0 1 40,83 44,44 0 0 1 84,39 44,44 0 0 1 128,83 Z
        @left
    </string>

    <string translatable="false" name="config_mainBuiltInDisplayCutoutRectApproximation">
        M 0.0,0.0
        h 136
        v 136
        h -136
        Z
        @left
    </string>

    <!-- 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>

    <!-- Height of the status bar -->
    <dimen name="status_bar_height_portrait">136px</dimen>
    <dimen name="status_bar_height_landscape">28dp</dimen>
    <!-- Height of area above QQS where battery/time go (equal to status bar) -->
    <dimen name="quick_qs_offset_height">136px</dimen>
    <!-- Total height of QQS (quick_qs_offset_height + 128) -->
    <dimen name="quick_qs_total_height">488px</dimen>

</resources>

Loading