diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-12-04 13:28:23 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-12-04 13:28:23 +0000 |
commit | 4331966d94f34bf041f49d6c3236e04eb0d2a2ef (patch) | |
tree | fbe7f07a56045a0f40651fd864ada21e9eb40a87 | |
parent | 6b6376b4665b0628a5d1e8fb091be2721f811a5f (diff) | |
parent | ac51743c23bc7ddeb01f890d6a3af0dd17ea4fb3 (diff) | |
download | goldfish-android14-mainline-sdkext-release.tar.gz |
Snap for 11173240 from ac51743c23bc7ddeb01f890d6a3af0dd17ea4fb3 to mainline-sdkext-releaseaml_sdk_341510000aml_sdk_341410000android14-mainline-sdkext-release
Change-Id: I9b6cb18d4d5b3086d6973d3f0d9918a37484e72f
72 files changed, 2015 insertions, 167 deletions
diff --git a/64bitonly/product/emulator64_vendor.mk b/64bitonly/product/emulator64_vendor.mk index 37c2659e..254425a2 100644 --- a/64bitonly/product/emulator64_vendor.mk +++ b/64bitonly/product/emulator64_vendor.mk @@ -28,7 +28,11 @@ endif PRODUCT_PACKAGES += \ vndk-sp +ifeq ($(EMULATOR_DISABLE_RADIO),true) +DEVICE_PACKAGE_OVERLAYS += device/generic/goldfish/tablet/overlay +else DEVICE_PACKAGE_OVERLAYS := device/generic/goldfish/overlay +endif PRODUCT_CHARACTERISTICS := emulator diff --git a/64bitonly/product/sdk_phone64_arm64.mk b/64bitonly/product/sdk_phone64_arm64.mk index 2188a43c..7fcb2fd9 100644 --- a/64bitonly/product/sdk_phone64_arm64.mk +++ b/64bitonly/product/sdk_phone64_arm64.mk @@ -22,6 +22,10 @@ PRODUCT_USE_DYNAMIC_PARTITIONS := true PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed +# 1.5G + 8M +BOARD_SUPER_PARTITION_SIZE := 1619001344 +BOARD_EMULATOR_DYNAMIC_PARTITIONS_SIZE := 1610612736 + # # All components inherited here go to system image # @@ -55,5 +59,5 @@ $(call inherit-product, device/generic/goldfish/emulator64_arm64/device.mk) # Overrides PRODUCT_BRAND := Android PRODUCT_NAME := sdk_phone64_arm64 -PRODUCT_DEVICE := emulator64_arm64 +PRODUCT_DEVICE := emu64a PRODUCT_MODEL := Android SDK built for arm64 diff --git a/64bitonly/product/sdk_phone64_x86_64.mk b/64bitonly/product/sdk_phone64_x86_64.mk index 1082c6ed..89821fab 100644 --- a/64bitonly/product/sdk_phone64_x86_64.mk +++ b/64bitonly/product/sdk_phone64_x86_64.mk @@ -15,6 +15,10 @@ # PRODUCT_USE_DYNAMIC_PARTITIONS := true +# 1.5G + 8M +BOARD_SUPER_PARTITION_SIZE := 1619001344 +BOARD_EMULATOR_DYNAMIC_PARTITIONS_SIZE := 1610612736 + # # All components inherited here go to system image # @@ -53,5 +57,5 @@ $(call inherit-product, device/generic/goldfish/emulator64_x86_64/device.mk) # Overrides PRODUCT_BRAND := Android PRODUCT_NAME := sdk_phone64_x86_64 -PRODUCT_DEVICE := emulator64_x86_64 +PRODUCT_DEVICE := emu64x PRODUCT_MODEL := Android SDK built for x86_64 diff --git a/64bitonly/product/sdk_tablet_arm64.mk b/64bitonly/product/sdk_tablet_arm64.mk new file mode 100644 index 00000000..96440967 --- /dev/null +++ b/64bitonly/product/sdk_tablet_arm64.mk @@ -0,0 +1,99 @@ +# +# Copyright (C) 2023 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. +# +PRODUCT_USE_DYNAMIC_PARTITIONS := true +EMULATOR_DISABLE_RADIO := true + +# 1.5G + 8M +BOARD_SUPER_PARTITION_SIZE := 1619001344 +BOARD_EMULATOR_DYNAMIC_PARTITIONS_SIZE := 1610612736 + +PRODUCT_COPY_FILES += \ + device/generic/goldfish/tablet/data/etc/display_settings.xml:$(TARGET_COPY_OUT_VENDOR)/etc/display_settings.xml \ + device/generic/goldfish/data/etc/advancedFeatures.ini.tablet:advancedFeatures.ini \ + device/generic/goldfish/data/etc/config.ini.nexus7tab:config.ini + +PRODUCT_COPY_FILES+= \ + device/generic/goldfish/data/etc/tablet_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml + +PRODUCT_COPY_FILES += device/generic/goldfish/tablet/data/etc/tablet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/tablet.xml + +PRODUCT_CHARACTERISTICS := tablet,nosdcard + + +# +# All components inherited here go to system image +# +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) + +# Enable mainline checking for excat this product name +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed + + +# +# All components inherited here go to system_ext image +# +$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system_ext.mk) + +# +# All components inherited here go to product image +# +# Includes all AOSP product packages +$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_product.mk) + +# Default AOSP sounds +$(call inherit-product-if-exists, frameworks/base/data/sounds/AllAudio.mk) + +# Additional settings used in all AOSP builds +PRODUCT_PRODUCT_PROPERTIES += \ + ro.config.ringtone?=Ring_Synth_04.ogg \ + ro.config.notification_sound?=pixiedust.ogg \ + + +# More AOSP packages +PRODUCT_PACKAGES += \ + initial-package-stopped-states-aosp.xml \ + PhotoTable \ + preinstalled-packages-platform-aosp-product.xml \ + WallpaperPicker \ + + +# Window Extensions +$(call inherit-product, $(SRC_TARGET_DIR)/product/window_extensions.mk) + +# Other packages for virtual device testing. +PRODUCT_PACKAGES += \ + LargeScreenSettingsProviderOverlay \ + curl \ + +PRODUCT_ARTIFACT_PATH_REQUIREMENT_ALLOWED_LIST += system/bin/curl + +PRODUCT_SDK_ADDON_SYS_IMG_SOURCE_PROP := \ + device/generic/goldfish/64bitonly/product/tablet_images_arm64-v8a_source.prop_template + +# +# All components inherited here go to vendor image +# +$(call inherit-product, device/generic/goldfish/arm64-vendor.mk) +$(call inherit-product, device/generic/goldfish/64bitonly/product/emulator64_vendor.mk) +$(call inherit-product, device/generic/goldfish/emulator64_arm64/device.mk) + +# Overrides +PRODUCT_BRAND := Android +PRODUCT_NAME := sdk_tablet_arm64 +PRODUCT_DEVICE := emu64a +PRODUCT_MODEL := Android SDK Tablet for arm64 + diff --git a/64bitonly/product/sdk_tablet_x86_64.mk b/64bitonly/product/sdk_tablet_x86_64.mk index bbc6cca2..271d24b3 100644 --- a/64bitonly/product/sdk_tablet_x86_64.mk +++ b/64bitonly/product/sdk_tablet_x86_64.mk @@ -1,5 +1,5 @@ # -# Copyright (C) 2021 The Android Open Source Project +# Copyright (C) 2023 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. @@ -16,29 +16,74 @@ PRODUCT_USE_DYNAMIC_PARTITIONS := true EMULATOR_DISABLE_RADIO := true +# 1.5G + 8M +BOARD_SUPER_PARTITION_SIZE := 1619001344 +BOARD_EMULATOR_DYNAMIC_PARTITIONS_SIZE := 1610612736 + + PRODUCT_COPY_FILES += \ + device/generic/goldfish/tablet/data/etc/display_settings.xml:$(TARGET_COPY_OUT_VENDOR)/etc/display_settings.xml \ device/generic/goldfish/data/etc/advancedFeatures.ini.tablet:advancedFeatures.ini \ device/generic/goldfish/data/etc/config.ini.nexus7tab:config.ini +PRODUCT_COPY_FILES+= \ + device/generic/goldfish/data/etc/tablet_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml + +PRODUCT_COPY_FILES += device/generic/goldfish/tablet/data/etc/tablet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/tablet.xml + PRODUCT_CHARACTERISTICS := tablet,nosdcard + # # All components inherited here go to system image # $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_no_telephony.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # Enable mainline checking for excat this product name -ifeq (sdk_tablet_x86_64,$(TARGET_PRODUCT)) PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed -endif + + +# +# All components inherited here go to system_ext image +# +$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system_ext.mk) # # All components inherited here go to product image # +# Includes all AOSP product packages +$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_product.mk) + +# Default AOSP sounds +$(call inherit-product-if-exists, frameworks/base/data/sounds/AllAudio.mk) + +# Additional settings used in all AOSP builds +PRODUCT_PRODUCT_PROPERTIES += \ + ro.config.ringtone?=Ring_Synth_04.ogg \ + ro.config.notification_sound?=pixiedust.ogg \ + + +# More AOSP packages +PRODUCT_PACKAGES += \ + initial-package-stopped-states-aosp.xml \ + PhotoTable \ + preinstalled-packages-platform-aosp-product.xml \ + WallpaperPicker \ + + +# Window Extensions +$(call inherit-product, $(SRC_TARGET_DIR)/product/window_extensions.mk) + +# Other packages for virtual device testing. +PRODUCT_PACKAGES += \ + LargeScreenSettingsProviderOverlay \ + curl \ + +PRODUCT_ARTIFACT_PATH_REQUIREMENT_ALLOWED_LIST += system/bin/curl PRODUCT_SDK_ADDON_SYS_IMG_SOURCE_PROP := \ - development/sys-img/images_x86_64_source.prop_template + device/generic/goldfish/64bitonly/product/tablet_images_x86_64_source.prop_template # # All components inherited here go to vendor image @@ -47,9 +92,9 @@ $(call inherit-product, device/generic/goldfish/64bitonly/product/x86_64-vendor. $(call inherit-product, device/generic/goldfish/64bitonly/product/emulator64_vendor.mk) $(call inherit-product, device/generic/goldfish/emulator64_x86_64/device.mk) - # Overrides PRODUCT_BRAND := Android PRODUCT_NAME := sdk_tablet_x86_64 -PRODUCT_DEVICE := emulator64_x86_64 -PRODUCT_MODEL := Android SDK built for x86_64 +PRODUCT_DEVICE := emu64x +PRODUCT_MODEL := Android SDK Tablet for x86_64 + diff --git a/64bitonly/product/tablet_images_arm64-v8a_source.prop_template b/64bitonly/product/tablet_images_arm64-v8a_source.prop_template new file mode 100644 index 00000000..5463d6aa --- /dev/null +++ b/64bitonly/product/tablet_images_arm64-v8a_source.prop_template @@ -0,0 +1,12 @@ +Pkg.Desc=Tablet Android SDK System Image +Pkg.UserSrc=false +Pkg.Revision=1 +Pkg.Dependencies=emulator#29.1.11 +AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION} +AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME} +AndroidVersion.ExtensionLevel=${PLATFORM_SDK_EXTENSION_VERSION} +AndroidVersion.IsBaseSdk=${PLATFORM_IS_BASE_SDK} +SystemImage.Abi=arm64-v8a +SystemImage.GpuSupport=true +SystemImage.TagId=aosp_tablet +SystemImage.TagDisplay=Tablet Default Android System Image diff --git a/64bitonly/product/tablet_images_x86_64_source.prop_template b/64bitonly/product/tablet_images_x86_64_source.prop_template new file mode 100644 index 00000000..722d0855 --- /dev/null +++ b/64bitonly/product/tablet_images_x86_64_source.prop_template @@ -0,0 +1,12 @@ +Pkg.Desc=Tablet Android SDK System Image +Pkg.UserSrc=false +Pkg.Revision=1 +Pkg.Dependencies=emulator#29.1.11 +AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION} +AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME} +AndroidVersion.ExtensionLevel=${PLATFORM_SDK_EXTENSION_VERSION} +AndroidVersion.IsBaseSdk=${PLATFORM_IS_BASE_SDK} +SystemImage.Abi=x86_64 +SystemImage.GpuSupport=true +SystemImage.TagId=aosp_tablet +SystemImage.TagDisplay=Tablet Default Android System Image diff --git a/AndroidProducts.mk b/AndroidProducts.mk index 13bd09ed..9a22b546 100644 --- a/AndroidProducts.mk +++ b/AndroidProducts.mk @@ -2,6 +2,7 @@ PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/sdk_phone_x86_vendor.mk \ $(LOCAL_DIR)/64bitonly/product/sdk_phone64_x86_64.mk \ $(LOCAL_DIR)/64bitonly/product/sdk_phone64_x86_64_riscv64.mk \ + $(LOCAL_DIR)/64bitonly/product/sdk_tablet_arm64.mk \ $(LOCAL_DIR)/64bitonly/product/sdk_tablet_x86_64.mk \ $(LOCAL_DIR)/64bitonly/product/sdk_phone64_arm64.mk \ $(LOCAL_DIR)/64bitonly/product/sdk_slim_x86_64.mk \ diff --git a/MultiDisplayProvider/AndroidManifest.xml b/MultiDisplayProvider/AndroidManifest.xml index 3b3b1e34..5c203bdc 100644 --- a/MultiDisplayProvider/AndroidManifest.xml +++ b/MultiDisplayProvider/AndroidManifest.xml @@ -20,7 +20,11 @@ package="com.android.emulator.multidisplay" android:sharedUserId="android.uid.system" > + <uses-permission android:name="android.permission.HARDWARE_TEST" /> + <uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW" /> + <uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER" /> <uses-sdk android:minSdkVersion="19" /> + <application android:label="@string/app_name" android:persistent="true"> <receiver android:name=".MultiDisplayServiceReceiver" diff --git a/MultiDisplayProvider/jni/com_android_emulator_multidisplay.cpp b/MultiDisplayProvider/jni/com_android_emulator_multidisplay.cpp index 10e92828..26c7a439 100644 --- a/MultiDisplayProvider/jni/com_android_emulator_multidisplay.cpp +++ b/MultiDisplayProvider/jni/com_android_emulator_multidisplay.cpp @@ -43,6 +43,7 @@ static const uint8_t ADD = 1; static const uint8_t DEL = 2; static const uint8_t QUERY = 3; static const uint8_t BIND = 4; +static const uint8_t SET_DISPLAY = 0x10; static void fillMsg(std::vector<uint8_t>& buf, uint8_t cmd, uint8_t* data, uint32_t size) { // msg format is size(4B) + cmd(1B) + data(size B) @@ -125,6 +126,14 @@ static bool nativeReadPipe(JNIEnv* env, jobject obj, jintArray arr) { std::vector<uint8_t> args(length, 0); qemu_pipe_read_fully(gFd, args.data(), (size_t)length); switch(args[0]) { + case SET_DISPLAY: + ALOGV("received setdisplay event"); + *arrp = SET_DISPLAY; + for (int i = 1; i < 6; i++) { + *(arrp + i) = *(uint32_t*)(&args[(i - 1) * 4 + 1]); + } + env->ReleaseIntArrayElements(arr, arrp, JNI_COMMIT); + break; case ADD: { ALOGV("received add event"); *arrp = ADD; diff --git a/MultiDisplayProvider/src/com/android/emulator/multidisplay/MultiDisplayService.java b/MultiDisplayProvider/src/com/android/emulator/multidisplay/MultiDisplayService.java index 41da9237..d78cc4ee 100644 --- a/MultiDisplayProvider/src/com/android/emulator/multidisplay/MultiDisplayService.java +++ b/MultiDisplayProvider/src/com/android/emulator/multidisplay/MultiDisplayService.java @@ -17,15 +17,20 @@ package com.android.emulator.multidisplay; import android.app.Service; +import android.hardware.display.DisplayManager; +import android.hardware.display.VirtualDisplay; import android.content.Intent; import android.os.Handler; import android.os.IBinder; +import android.os.Messenger; +import android.os.Parcel; +import android.os.RemoteException; +import android.os.ServiceManager; import android.util.DebugUtils; import android.util.Log; -import android.hardware.display.DisplayManager; -import android.hardware.display.VirtualDisplay; import android.view.Surface; +import java.lang.Thread; import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.ArrayList; @@ -33,8 +38,6 @@ import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; -import android.os.Messenger; - public final class MultiDisplayService extends Service { private static final String TAG = "MultiDisplayService"; private static final String DISPLAY_NAME = "Emulator 2D Display"; @@ -47,6 +50,10 @@ public final class MultiDisplayService extends Service { private static final int MAX_DISPLAYS = 10; private static final int ADD = 1; private static final int DEL = 2; + // the following is used by resizabel to set display + // intentionally shifted 4 bits to avoid conflicting + // with existing multidisplay functions + private static final int SET_DISPLAY = 0x10; private static final int FLAGS = DisplayManager.VIRTUAL_DISPLAY_FLAG_PUBLIC | DisplayManager.VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY | @@ -55,6 +62,8 @@ public final class MultiDisplayService extends Service { 1 << 6 |//DisplayManager.VIRTUAL_DISPLAY_FLAG_SUPPORTS_TOUCH 1 << 9; //DisplayManager.VIRTUAL_DISPLAY_FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS; + private static final String SURFACE_COMPOSER_INTERFACE_KEY = "android.ui.ISurfaceComposer"; + private IBinder mSurfaceFlinger; private DisplayManager mDisplayManager; private VirtualDisplay mVirtualDisplay[]; private Surface mSurface[]; @@ -130,7 +139,7 @@ public final class MultiDisplayService extends Service { @Override public void onCreate() { - Log.d(TAG, "Creating service"); + Log.i(TAG, "Creating service"); super.onCreate(); @@ -359,12 +368,16 @@ public final class MultiDisplayService extends Service { while(nativeOpen() <= 0) { Log.e(TAG, "failed to open multiDisplay pipe, retry"); } + Log.d(TAG, "success open multiDisplay pipe"); while(true) { + Log.d(TAG, "waiting to read pipe"); int[] array = {0, 0, 0, 0, 0, 0}; if (!nativeReadPipe(array)) { + Log.e(TAG, "failed and try again"); continue; } - Log.v(TAG, "run(): array= " + Arrays.toString(array)); + Log.d(TAG, "have read something from pipe"); + Log.d(TAG, "run(): array= " + Arrays.toString(array)); switch (array[0]) { case ADD: { for (int j = 0; j < 6; j++) { @@ -392,6 +405,34 @@ public final class MultiDisplayService extends Service { deleteVirtualDisplay(i); break; } + case SET_DISPLAY: { + for (int j = 0; j < 6; j++) { + Log.d(TAG, "SET_DISPLAY received " + array[j]); + } + if (mSurfaceFlinger == null) { + Log.d(TAG, "obtain surfaceflinger " ); + mSurfaceFlinger = ServiceManager.getService("SurfaceFlinger"); + } + if (mSurfaceFlinger != null) { + int i = array[1]; + Parcel data = Parcel.obtain(); + data.writeInterfaceToken(SURFACE_COMPOSER_INTERFACE_KEY); + data.writeInt(i); + try { + if (i >=0) { + mSurfaceFlinger.transact(1035, data, null, 0 /* flags */); + Log.d(TAG, "setting display to " + i); + } else { + Log.e(TAG, "invalid display id " + i); + } + } catch (RemoteException e) { + Log.e(TAG, "Could not set display:" + e.toString()); + } + } else { + Log.e(TAG, "cannot get SurfaceFlinger service"); + } + break; + } // TODO(b/231763427): implement LIST } } diff --git a/camera/media/codecs_google_video_default.xml b/camera/media/codecs_google_video_default.xml index 7bb71216..f18991bf 100644 --- a/camera/media/codecs_google_video_default.xml +++ b/camera/media/codecs_google_video_default.xml @@ -47,7 +47,7 @@ <Limit name="measured-frame-rate-720x480" range="262-264" /> <Limit name="measured-frame-rate-1280x720" range="227-251" /> <Limit name="measured-frame-rate-1920x1080" range="235-247" /> - <Limit name="measured-frame-rate-3840x2160" range="235-247" /> + <Limit name="measured-frame-rate-3840x2160" range="90-120" /> <Feature name="adaptive-playback" /> </MediaCodec> <MediaCodec name="c2.goldfish.h264.decoder" type="video/avc"> @@ -62,7 +62,7 @@ <Limit name="measured-frame-rate-720x480" range="262-264" /> <Limit name="measured-frame-rate-1280x720" range="227-251" /> <Limit name="measured-frame-rate-1920x1080" range="235-247" /> - <Limit name="measured-frame-rate-3840x2160" range="235-247" /> + <Limit name="measured-frame-rate-3840x2160" range="90-120" /> <Feature name="adaptive-playback" /> </MediaCodec> <MediaCodec name="c2.goldfish.hevc.decoder" type="video/hevc"> @@ -73,11 +73,12 @@ <Limit name="bitrate" range="1-120000000" /> <Limit name="frame-rate" range="1-480" /> <Limit name="performance-point-3840x2160" value="30" /> - <Limit name="measured-frame-rate-320x240" range="257-266" /> + <Limit name="measured-frame-rate-320x240" range="257-400" /> + <Limit name="measured-frame-rate-352x288" range="252-400" /> <Limit name="measured-frame-rate-720x480" range="262-264" /> <Limit name="measured-frame-rate-1280x720" range="227-251" /> <Limit name="measured-frame-rate-1920x1080" range="235-247" /> - <Limit name="measured-frame-rate-3840x2160" range="235-247" /> + <Limit name="measured-frame-rate-3840x2160" range="90-120" /> <Feature name="adaptive-playback" /> </MediaCodec> <MediaCodec name="OMX.google.h264.decoder" type="video/avc"> @@ -118,7 +119,7 @@ <Limit name="measured-frame-rate-640x360" range="237-258" /> <Limit name="measured-frame-rate-1280x720" range="237-258" /> <Limit name="measured-frame-rate-1920x1080" range="293-302" /> - <Limit name="measured-frame-rate-3840x2160" range="150-150" /> + <Limit name="measured-frame-rate-3840x2160" range="90-120" /> <Feature name="adaptive-playback" /> </MediaCodec> <MediaCodec name="OMX.android.goldfish.vp8.decoder" type="video/x-vnd.on2.vp8"> @@ -144,7 +145,7 @@ <Limit name="bitrate" range="1-120000000" /> <Limit name="frame-rate" range="1-480" /> <Limit name="performance-point-1920x1080" value="30" /> - <Limit name="measured-frame-rate-320x180" range="743-817" /> + <Limit name="measured-frame-rate-320x180" range="300-400" /> <Limit name="measured-frame-rate-640x360" range="237-258" /> <Limit name="measured-frame-rate-1280x720" range="60-160" /> <Limit name="measured-frame-rate-1920x1080" range="30-160" /> @@ -158,7 +159,7 @@ <Limit name="bitrate" range="1-120000000" /> <Limit name="frame-rate" range="1-480" /> <Limit name="performance-point-3840x2160" value="30" /> - <Limit name="measured-frame-rate-320x180" range="950-970" /> + <Limit name="measured-frame-rate-320x180" range="300-400" /> <Limit name="measured-frame-rate-640x360" range="237-258" /> <Limit name="measured-frame-rate-1280x720" range="237-258" /> <Limit name="measured-frame-rate-1920x1080" range="100-120" /> diff --git a/camera/media/codecs_performance.xml b/camera/media/codecs_performance.xml index 022fd9c5..c243a54b 100644 --- a/camera/media/codecs_performance.xml +++ b/camera/media/codecs_performance.xml @@ -84,6 +84,8 @@ <MediaCodec name="OMX.google.mpeg4.decoder" type="video/mp4v-es" update="true"> <!-- 4 runs, min 1439 max 1625 gmean 1523 --> <Limit name="measured-frame-rate-176x144" range="1439-1625" /> + <Limit name="measured-frame-rate-480x360" range="200-400" /> + <Limit name="measured-frame-rate-1280x720" range="100-200" /> </MediaCodec> <MediaCodec name="OMX.google.vp8.decoder" type="video/x-vnd.on2.vp8" update="true"> <!-- 3 runs, min 1129 max 1261 gmean 1190 --> diff --git a/camera/media/codecs_performance_c2.xml b/camera/media/codecs_performance_c2.xml index 62061ab7..03778737 100644 --- a/camera/media/codecs_performance_c2.xml +++ b/camera/media/codecs_performance_c2.xml @@ -33,7 +33,7 @@ </MediaCodec> <MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true"> <!-- measured 90%:799-924 med:815 N=12 --> - <Limit name="measured-frame-rate-320x180" range="814-859" /> <!-- v90%=1.1 --> + <Limit name="measured-frame-rate-320x180" range="300-400" /> <!-- v90%=1.1 --> <!-- measured 90%:338-379 med:345 N=12 --> <Limit name="measured-frame-rate-640x360" range="344-358" /> <!-- v90%=1.1 --> <Limit name="measured-frame-rate-1280x720" range="88-92" /> <!-- N=50 v90%=1.1 --> @@ -54,7 +54,8 @@ <!-- MANUALLY ADJUSTED --> <Limit name="measured-frame-rate-320x180" range="156-362" /> <!-- MANUALLY ADJUSTED --> - <Limit name="measured-frame-rate-640x360" range="63-162" /> + <Limit name="measured-frame-rate-640x360" range="100-200" /> + <Limit name="measured-frame-rate-720x480" range="100-200" /> <!-- MANUALLY ADJUSTED --> <Limit name="measured-frame-rate-1280x720" range="40-110" /> <!-- MANUALLY ADJUSTED --> @@ -69,6 +70,8 @@ <MediaCodec name="c2.android.mpeg4.decoder" type="video/mp4v-es" update="true"> <!-- measured 90%:1298-1653 med:1316 SLOW N=12 --> <Limit name="measured-frame-rate-176x144" range="540-590" /> <!-- v90%=1.1 --> + <Limit name="measured-frame-rate-480x360" range="200-400" /> <!-- v90%=1.1 --> + <Limit name="measured-frame-rate-1280x720" range="100-200" /> <!-- v90%=1.1 --> </MediaCodec> </Decoders> @@ -90,23 +93,23 @@ <Limit name="measured-frame-rate-176x144" range="1400-1560" /> <!-- SHOULDN'T HAVE TWEAKED N=220 v90%=4.0 --> </MediaCodec> <MediaCodec name="c2.android.vp8.encoder" type="video/x-vnd.on2.vp8" update="true"> - <Limit name="measured-frame-rate-320x180" range="178-245" /> <!-- Manual N=20 --> - <Limit name="measured-frame-rate-640x360" range="100-126" /> <!-- Manual N=20 --> + <Limit name="measured-frame-rate-320x180" range="200-300" /> <!-- Manual N=20 --> + <Limit name="measured-frame-rate-640x360" range="200-300" /> <!-- Manual N=20 --> <Limit name="measured-frame-rate-1280x720" range="35-37" /> <!-- Manual N=20 --> <Limit name="measured-frame-rate-1920x1080" range="24-31" /> <!-- Manual N=20 --> </MediaCodec> <MediaCodec name="c2.android.vp9.encoder" type="video/x-vnd.on2.vp9" update="true"> - <Limit name="measured-frame-rate-320x180" range="109-109" /> <!-- v93%=1.3 --> + <Limit name="measured-frame-rate-320x180" range="300-400" /> <!-- v93%=1.3 --> <Limit name="measured-frame-rate-640x360" range="61-61" /> <!-- v95%=1.1 --> <Limit name="measured-frame-rate-1280x720" range="20-20" /> <!-- v95%=1.3 --> </MediaCodec> <MediaCodec name="c2.android.av1.encoder" type="video/av01" update="true"> <!-- MANUALLY ADJUSTED --> - <Limit name="measured-frame-rate-320x240" range="84-130" /> + <Limit name="measured-frame-rate-320x240" range="300-400" /> <!-- MANUALLY ADJUSTED --> - <Limit name="measured-frame-rate-720x480" range="20-43" /> + <Limit name="measured-frame-rate-720x480" range="80-120" /> <!-- MANUALLY ADJUSTED --> - <Limit name="measured-frame-rate-1280x720" range="8-21" /> + <Limit name="measured-frame-rate-1280x720" range="40-50" /> </MediaCodec> </Encoders> </MediaCodecs> diff --git a/data/etc/config.ini.pixeltablet b/data/etc/config.ini.pixeltablet new file mode 100644 index 00000000..a4e7f922 --- /dev/null +++ b/data/etc/config.ini.pixeltablet @@ -0,0 +1,46 @@ +AvdId = Pixel_Tablet_API_34 +PlayStore.enabled = true +abi.type = x86_64 +avd.ini.displayname = Pixel Tablet API 34 +avd.ini.encoding = UTF-8 +disk.dataPartition.size = 6442450944 +fastboot.chosenSnapshotFile = +fastboot.forceChosenSnapshotBoot = no +fastboot.forceColdBoot = no +fastboot.forceFastBoot = yes +hw.accelerometer = yes +hw.arc = false +hw.audioInput = yes +hw.battery = yes +hw.camera.back = virtualscene +hw.camera.front = emulated +hw.cpu.arch = x86_64 +hw.cpu.ncore = 4 +hw.dPad = no +hw.device.hash2 = MD5:3eb16c85159ad6e1cbb3263194d1a735 +hw.device.manufacturer = Google +hw.device.name = pixel_tablet +hw.gps = no +hw.gpu.enabled = yes +hw.gpu.mode = auto +hw.initialOrientation = landscape +hw.keyboard = yes +hw.lcd.density = 320 +hw.lcd.height = 1600 +hw.lcd.width = 2560 +hw.mainKeys = no +hw.ramSize = 2048 +hw.sdCard = yes +hw.sensors.orientation = yes +hw.sensors.proximity = no +hw.trackBall = no +runtime.network.latency = none +runtime.network.speed = full +sdcard.size = 512M +showDeviceFrame = no +skin.dynamic = yes +skin.name = 2560x1600 +skin.path.backup = pixel_tablet +tag.display = Google Play +tag.id = google_apis_playstore +vm.heapSize = 192 diff --git a/data/etc/google/64bit/user/advancedFeatures.ini b/data/etc/google/64bit/user/advancedFeatures.ini index d182daa9..027ece5f 100644 --- a/data/etc/google/64bit/user/advancedFeatures.ini +++ b/data/etc/google/64bit/user/advancedFeatures.ini @@ -4,6 +4,7 @@ GLDMA = on LogcatPipe = on GLAsyncSwap = on GLESDynamicVersion = on +HWCMultiConfigs = on PlayStoreImage = on EncryptUserData = on IntelPerformanceMonitoringUnit = on diff --git a/data/etc/google/64bit/user/advancedFeatures.ini.tablet b/data/etc/google/64bit/user/advancedFeatures.ini.tablet new file mode 100644 index 00000000..2fe44f82 --- /dev/null +++ b/data/etc/google/64bit/user/advancedFeatures.ini.tablet @@ -0,0 +1,29 @@ +BluetoothEmulation = on +GrallocSync = on +GLDMA = on +LogcatPipe = on +GLAsyncSwap = on +GLESDynamicVersion = on +PlayStoreImage = on +EncryptUserData = on +IntelPerformanceMonitoringUnit = on +VirtioWifi = on +HostComposition = on +RefCountPipe = on +VirtioInput = on +HardwareDecoder = on +DynamicPartition = on +MultiDisplay = on +YUVCache = on +GLDirectMem = on +VulkanNullOptionalStrings = on +VulkanIgnoredHandles = on +Mac80211hwsimUserspaceManaged = on +VirtconsoleLogcat = on +VirtioVsockPipe = on +AndroidbootProps2 = on +DeviceSkinOverlay = on +VulkanQueueSubmitWithCommands = on +VulkanBatchedDescriptorSetUpdate = on +DeviceStateOnBoot = on +VirtioSndCard = on diff --git a/data/etc/google/64bit/user/arm64/advancedFeatures.ini b/data/etc/google/64bit/user/arm64/advancedFeatures.ini index 87fd5bb0..97e3b58f 100644 --- a/data/etc/google/64bit/user/arm64/advancedFeatures.ini +++ b/data/etc/google/64bit/user/arm64/advancedFeatures.ini @@ -4,6 +4,7 @@ GLDMA = on LogcatPipe = on GLAsyncSwap = on GLESDynamicVersion = on +HWCMultiConfigs = on PlayStoreImage = on EncryptUserData = on VirtioWifi = on diff --git a/data/etc/google/64bit/user/arm64/advancedFeatures.ini.tablet b/data/etc/google/64bit/user/arm64/advancedFeatures.ini.tablet new file mode 100644 index 00000000..c32cfc07 --- /dev/null +++ b/data/etc/google/64bit/user/arm64/advancedFeatures.ini.tablet @@ -0,0 +1,28 @@ +BluetoothEmulation = on +GrallocSync = on +GLDMA = on +LogcatPipe = on +GLAsyncSwap = on +GLESDynamicVersion = on +PlayStoreImage = on +EncryptUserData = on +VirtioWifi = on +HostComposition = on +RefCountPipe = on +VirtioInput = on +HardwareDecoder = on +DynamicPartition = on +MultiDisplay = on +YUVCache = on +GLDirectMem = on +VulkanNullOptionalStrings = on +VulkanIgnoredHandles = on +Mac80211hwsimUserspaceManaged = on +VirtconsoleLogcat = on +VirtioVsockPipe = on +AndroidbootProps2 = on +DeviceSkinOverlay = on +VulkanQueueSubmitWithCommands = on +VulkanBatchedDescriptorSetUpdate = on +DeviceStateOnBoot = on +VirtioSndCard = on diff --git a/data/etc/google/64bit/userdebug/advancedFeatures.ini.tablet b/data/etc/google/64bit/userdebug/advancedFeatures.ini.tablet new file mode 100644 index 00000000..0810dfeb --- /dev/null +++ b/data/etc/google/64bit/userdebug/advancedFeatures.ini.tablet @@ -0,0 +1,29 @@ +BluetoothEmulation = on +GrallocSync = on +GLDMA = on +LogcatPipe = on +GLAsyncSwap = on +GLESDynamicVersion = on +EncryptUserData = on +IntelPerformanceMonitoringUnit = on +VirtioWifi = on +HostComposition = on +RefCountPipe = on +VirtioInput = on +HardwareDecoder = on +DynamicPartition = on +MultiDisplay = on +YUVCache = on +GLDirectMem = on +VulkanNullOptionalStrings = on +VulkanIgnoredHandles = on +Mac80211hwsimUserspaceManaged = on +VirtconsoleLogcat = on +VirtioVsockPipe = on +AndroidbootProps2 = on +DeviceSkinOverlay = on +VulkanQueueSubmitWithCommands = on +VulkanBatchedDescriptorSetUpdate = on +DeviceStateOnBoot = on +HWCMultiConfigs = on +VirtioSndCard = on diff --git a/data/etc/google/64bit/userdebug/arm64/advancedFeatures.ini.tablet b/data/etc/google/64bit/userdebug/arm64/advancedFeatures.ini.tablet new file mode 100644 index 00000000..86a27ea5 --- /dev/null +++ b/data/etc/google/64bit/userdebug/arm64/advancedFeatures.ini.tablet @@ -0,0 +1,28 @@ +BluetoothEmulation = on +GrallocSync = on +GLDMA = on +LogcatPipe = on +GLAsyncSwap = on +GLESDynamicVersion = on +EncryptUserData = on +VirtioWifi = on +HostComposition = on +RefCountPipe = on +VirtioInput = on +HardwareDecoder = on +DynamicPartition = on +MultiDisplay = on +YUVCache = on +GLDirectMem = on +VulkanNullOptionalStrings = on +VulkanIgnoredHandles = on +Mac80211hwsimUserspaceManaged = on +VirtconsoleLogcat = on +VirtioVsockPipe = on +AndroidbootProps2 = on +DeviceSkinOverlay = on +VulkanQueueSubmitWithCommands = on +VulkanBatchedDescriptorSetUpdate = on +DeviceStateOnBoot = on +HWCMultiConfigs = on +VirtioSndCard = on diff --git a/data/etc/handheld_core_hardware.xml b/data/etc/handheld_core_hardware.xml index ef206276..5c2227fd 100644 --- a/data/etc/handheld_core_hardware.xml +++ b/data/etc/handheld_core_hardware.xml @@ -53,6 +53,7 @@ <feature name="android.hardware.sensor.gyroscope" /> <feature name="android.hardware.sensor.hinge_angle" /> <feature name="android.hardware.telephony" /> + <feature name="android.hardware.telephony.calling" /> <feature name="android.hardware.telephony.data" /> <feature name="android.hardware.telephony.gsm" /> <feature name="android.hardware.telephony.ims" /> diff --git a/data/etc/permissions/privapp-permissions-multidisplay.xml b/data/etc/permissions/privapp-permissions-multidisplay.xml new file mode 100644 index 00000000..7e79a604 --- /dev/null +++ b/data/etc/permissions/privapp-permissions-multidisplay.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2023 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 + --> +<!-- +This XML file declares which signature|privileged permissions should be granted to privileged +applications on GMS or Google-branded devices. +It allows additional grants on top of privapp-permissions-platform.xml +--> +<permissions> + <privapp-permissions package="com.android.emulator.multidisplay"> + <permission name="android.permission.HARDWARE_TEST"/> + <permission name="android.permission.INTERNAL_SYSTEM_WINDOW"/> + <permission name="android.permission.ACCESS_SURFACE_FLINGER"/> + </privapp-permissions> +</permissions> + diff --git a/data/etc/tablet_core_hardware.xml b/data/etc/tablet_core_hardware.xml new file mode 100644 index 00000000..54b7bb88 --- /dev/null +++ b/data/etc/tablet_core_hardware.xml @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2023 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 are the hardware components that all handheld devices + must include. Devices with optional hardware must also include extra + hardware files, per the comments below. + + Handheld devices include phones, mobile Internet devices (MIDs), + Personal Media Players (PMPs), small tablets (7" or less), and similar + devices. + + This file is similar to device/generic/goldfish/data/etc/handheld_core_hardware.xml. + with out telephony or hinge sensors +--> +<permissions> + <feature name="android.hardware.audio.output" /> + <feature name="android.hardware.bluetooth" /> + <feature name="android.hardware.camera" /> + <feature name="android.hardware.location" /> + <feature name="android.hardware.location.gps" /> + <feature name="android.hardware.location.network" /> + <feature name="android.hardware.sensor.accelerometer" /> + <feature name="android.hardware.sensor.ambient_temperature" /> + <feature name="android.hardware.sensor.compass" /> + <feature name="android.hardware.sensor.barometer" /> + <feature name="android.hardware.sensor.light" /> + <feature name="android.hardware.sensor.proximity" /> + <feature name="android.hardware.sensor.relative_humidity" /> + <feature name="android.hardware.sensor.gyroscope" /> + <feature name="android.hardware.touchscreen" /> + <feature name="android.hardware.microphone" /> + <feature name="android.hardware.screen.portrait" /> + <feature name="android.hardware.screen.landscape" /> + + <!-- basic system services --> + <feature name="android.software.app_widgets" /> + <feature name="android.software.voice_recognizers" notLowRam="true" /> + <feature name="android.software.backup" /> + <feature name="android.software.home_screen" /> + <feature name="android.software.input_methods" /> + <feature name="android.software.midi" /> + <feature name="android.software.print" /> + <feature name="android.software.cant_save_state" /> + <feature name="android.software.secure_lock_screen" /> + <feature name="android.software.companion_device_setup" /> + <feature name="android.software.credentials" /> + + <!-- Feature to specify if the device supports adding device admins. --> + <feature name="android.software.device_admin" /> + + <!-- Feature to specify if the device support managed users. --> + <feature name="android.software.managed_users" /> + + <feature name="android.software.picture_in_picture" /> + <feature name="android.software.activities_on_secondary_displays" /> + + <feature name="android.software.cts" /> + + <feature name="android.hardware.security.model.compatible" /> + + <!-- Feature to specify if the device supports controls. --> + <feature name="android.software.controls" /> + + <!-- devices with GPS must include android.hardware.location.gps.xml --> + <!-- devices with an autofocus camera and/or flash must include either + android.hardware.camera.autofocus.xml or + android.hardware.camera.autofocus-flash.xml --> + <!-- devices with a front facing camera must include + android.hardware.camera.front.xml --> + <!-- devices with WiFi must also include android.hardware.wifi.xml --> + <!-- devices that support multitouch must include the most appropriate one + of these files: + + If only partial (non-independent) pointers are supported: + android.hardware.touchscreen.multitouch.xml + + If up to 4 independently tracked pointers are supported: + include android.hardware.touchscreen.multitouch.distinct.xml + + If 5 or more independently tracked pointers are supported: + include android.hardware.touchscreen.multitouch.jazzhand.xml + + ONLY ONE of the above should be included. --> + <!-- devices with an ambient light sensor must also include + android.hardware.sensor.light.xml --> + <!-- devices with a proximity sensor must also include + android.hardware.sensor.proximity.xml --> + <!-- GSM phones must also include android.hardware.telephony.gsm.xml --> + <!-- CDMA phones must also include android.hardware.telephony.cdma.xml --> + <!-- Devices that have low-latency audio stacks suitable for apps like + VoIP may include android.hardware.audio.low_latency.xml. ONLY apps + that meet the requirements specified in the CDD may include this. --> +</permissions> diff --git a/init.ranchu.rc b/init.ranchu.rc index 1084713d..6d6dfb56 100644 --- a/init.ranchu.rc +++ b/init.ranchu.rc @@ -56,7 +56,6 @@ on init start qemu-props on post-fs-data - setprop vold.post_fs_data_done 1 mkdir /data/vendor/adb 0755 root root mkdir /data/vendor/devicestate 0755 root root mkdir /data/vendor/var 0755 root root diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index 24000382..841bc694 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -27,6 +27,39 @@ <!-- Whether Multiuser UI should be shown --> <bool name="config_enableMultiUserUI">true</bool> + <!-- Map of System DeviceState supplied by DeviceStateManager to WM Jetpack posture. --> + <string-array name="config_device_state_postures" translatable="false"> + <item>0:1</item> <!-- CLOSED --> + <item>1:2</item> <!-- HALF_OPENED --> + <item>2:3</item> <!-- OPENED --> + <item>3:1</item> <!-- FLIPPED --> + </string-array> + + <!-- The device states (supplied by DeviceStateManager) that should be treated as open by the + display fold controller. --> + <integer-array name="config_openDeviceStates" translatable="false"> + <item>2</item> <!-- OPEN --> + </integer-array> + + <!-- The device states (supplied by DeviceStateManager) that should be treated as folded by the + display fold controller. This also controls the folded bit in CameraServiceProxy. --> + <integer-array name="config_foldedDeviceStates" translatable="false"> + <item>0</item> <!-- CLOSED --> + </integer-array> + + <!-- The device states (supplied by DeviceStateManager) that should be treated as half folded by + the display fold controller. This also controls the folded bit in CameraServiceProxy. --> + <integer-array name="config_halfFoldedDeviceStates" translatable="false"> + <item>1</item> <!-- HALF_OPENED --> + </integer-array> + + <!-- The device states (supplied by DeviceStateManager) that should be treated as a rear display + state. Default is empty. --> + <integer-array name="config_rearDisplayDeviceStates" translatable="false"> + <item>3</item> <!-- REAR_DISPLAY_STATE --> + </integer-array> + + <!-- Set to true to add links to Cell Broadcast app from Settings and MMS app. --> <bool name="config_cellBroadcastAppLinks">true</bool> @@ -46,20 +79,7 @@ <item>"wlan\\d"</item> </string-array> - <!-- Map of System DeviceState supplied by DeviceStateManager to WM Jetpack posture. --> - <string-array name="config_device_state_postures" translatable="false"> - <item>1:1</item> <!-- CLOSED --> - <item>2:2</item> <!-- HALF_OPENED --> - <item>3:3</item> <!-- OPENED --> - <item>4:4</item> <!-- FLIPPED --> - <item>5:5</item> <!-- TENT --> - </string-array> - <!-- The device states (supplied by DeviceStateManager) that should be treated as folded by the - display fold controller. --> - <integer-array name="config_foldedDeviceStates" translatable="false"> - <item>1</item> <!-- CLOSED --> - </integer-array> <!-- This device is able to support the microphone and camera global toggles. --> <bool name="config_supportsMicToggle">true</bool> @@ -72,6 +92,13 @@ <item>network</item> </string-array> + <string-array name="config_perDeviceStateRotationLockDefaults" translatable="false"> + <item>0:1</item> <!-- CLOSED -> LOCKED --> + <item>2:0:1</item> <!-- HALF_OPENED -> IGNORED and fallback to device state OPENED --> + <item>1:2</item> <!-- OPENED -> UNLOCKED --> + </string-array> + <bool name="config_supportMicNearUltrasound">true</bool> <bool name="config_supportSpeakerNearUltrasound">true</bool> + </resources> diff --git a/overlay/frameworks/base/packages/overlays/pixel_7a/AndroidOverlay/Android.mk b/overlay/frameworks/base/packages/overlays/pixel_7a/AndroidOverlay/Android.mk new file mode 100644 index 00000000..ddbe7155 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_7a/AndroidOverlay/Android.mk @@ -0,0 +1,31 @@ +# +# Copyright 2023, 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. +# + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_RRO_THEME := EmulationPixel7a + +LOCAL_PRODUCT_MODULE := true + +LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res + +LOCAL_PACKAGE_NAME := EmulationPixel7aOverlay +LOCAL_SDK_VERSION := current + +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +include $(BUILD_RRO_PACKAGE) diff --git a/overlay/frameworks/base/packages/overlays/pixel_7a/AndroidOverlay/AndroidManifest.xml b/overlay/frameworks/base/packages/overlays/pixel_7a/AndroidOverlay/AndroidManifest.xml new file mode 100644 index 00000000..90d27178 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_7a/AndroidOverlay/AndroidManifest.xml @@ -0,0 +1,24 @@ +<!-- +/** + * Copyright (c) 2023, 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.emulation.pixel_7a" + android:versionCode="1" + android:versionName="1.0"> + <overlay android:targetPackage="android" android:priority="1"/> + <application android:label="Filled" android:hasCode="false"/> +</manifest> diff --git a/overlay/frameworks/base/packages/overlays/pixel_7a/AndroidOverlay/res/values/config.xml b/overlay/frameworks/base/packages/overlays/pixel_7a/AndroidOverlay/res/values/config.xml new file mode 100644 index 00000000..10e50675 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_7a/AndroidOverlay/res/values/config.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2023, 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"> + <!-- 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> +</resources> diff --git a/overlay/frameworks/base/packages/overlays/pixel_7a/AndroidOverlay/res/values/dimens.xml b/overlay/frameworks/base/packages/overlays/pixel_7a/AndroidOverlay/res/values/dimens.xml new file mode 100644 index 00000000..be8d827a --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_7a/AndroidOverlay/res/values/dimens.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (c) 2023, 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> diff --git a/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/Android.mk b/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/Android.mk new file mode 100644 index 00000000..79b53f08 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/Android.mk @@ -0,0 +1,31 @@ +# +# Copyright 2023, 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. +# + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_RRO_THEME := SystemUIEmulationPixel7a + +LOCAL_PRODUCT_MODULE := true + +LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res + +LOCAL_PACKAGE_NAME := SystemUIEmulationPixel7aOverlay +LOCAL_SDK_VERSION := current + +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +include $(BUILD_RRO_PACKAGE) diff --git a/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/AndroidManifest.xml b/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/AndroidManifest.xml new file mode 100644 index 00000000..4ec829db --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/AndroidManifest.xml @@ -0,0 +1,24 @@ +<!-- +/** + * Copyright (c) 2023, 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.systemui.emulation.pixel_7a" + android:versionCode="1" + android:versionName="1.0"> + <overlay android:targetPackage="com.android.systemui" android:priority="1"/> + <application android:label="Filled" android:hasCode="false"/> +</manifest> diff --git a/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/res/drawable/rounded_corner_bottom.xml b/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/res/drawable/rounded_corner_bottom.xml new file mode 100644 index 00000000..fd372346 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/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> + diff --git a/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/res/drawable/rounded_corner_top.xml b/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/res/drawable/rounded_corner_top.xml new file mode 100644 index 00000000..6735ec7e --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/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> + diff --git a/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/res/values-land/dimen.xml b/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/res/values-land/dimen.xml new file mode 100644 index 00000000..d52300a9 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/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> diff --git a/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/res/values/config.xml b/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/res/values/config.xml new file mode 100644 index 00000000..9b82fd4a --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/res/values/config.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2023, 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> + <!-- 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> diff --git a/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/res/values/dimens.xml b/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/res/values/dimens.xml new file mode 100644 index 00000000..f65748bd --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_7a/SystemUIOverlay/res/values/dimens.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (c) 2023, 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">730px</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">1064px</dimen> + <dimen name="physical_volume_down_button_center_screen_location_y">1232px</dimen> + +</resources> + diff --git a/overlay/frameworks/base/packages/overlays/pixel_8/AndroidOverlay/Android.mk b/overlay/frameworks/base/packages/overlays/pixel_8/AndroidOverlay/Android.mk new file mode 100644 index 00000000..1a81d336 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8/AndroidOverlay/Android.mk @@ -0,0 +1,31 @@ +# +# Copyright 2023, 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. +# + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_RRO_THEME := EmulationPixel8 + +LOCAL_PRODUCT_MODULE := true + +LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res + +LOCAL_PACKAGE_NAME := EmulationPixel8Overlay +LOCAL_SDK_VERSION := current + +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +include $(BUILD_RRO_PACKAGE) diff --git a/overlay/frameworks/base/packages/overlays/pixel_8/AndroidOverlay/AndroidManifest.xml b/overlay/frameworks/base/packages/overlays/pixel_8/AndroidOverlay/AndroidManifest.xml new file mode 100644 index 00000000..1090a5ef --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8/AndroidOverlay/AndroidManifest.xml @@ -0,0 +1,24 @@ +<!-- +/** + * Copyright (c) 2023, 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.emulation.pixel_8" + android:versionCode="1" + android:versionName="1.0"> + <overlay android:targetPackage="android" android:priority="1"/> + <application android:label="Filled" android:hasCode="false"/> +</manifest> diff --git a/overlay/frameworks/base/packages/overlays/pixel_8/AndroidOverlay/res/values/config.xml b/overlay/frameworks/base/packages/overlays/pixel_8/AndroidOverlay/res/values/config.xml new file mode 100644 index 00000000..449a3503 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8/AndroidOverlay/res/values/config.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2023, 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"> + <!-- 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 576,65.75 a 36.25,36.25 0 0 0 -72.5,0 36.25,36.25 0 0 0 72.5,0 z + @left + </string> + + <string translatable="false" name="config_mainBuiltInDisplayCutoutRectApproximation"> + M 478.5,0 + h 122 + v 132 + h -122 + Z + @left + </string> +</resources> diff --git a/overlay/frameworks/base/packages/overlays/pixel_8/AndroidOverlay/res/values/dimens.xml b/overlay/frameworks/base/packages/overlays/pixel_8/AndroidOverlay/res/values/dimens.xml new file mode 100644 index 00000000..295bddf3 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8/AndroidOverlay/res/values/dimens.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (c) 2023, 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">102px</dimen> + <dimen name="rounded_corner_radius_top">104px</dimen> + <dimen name="rounded_corner_radius_bottom">102px</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">132px</dimen> + <dimen name="status_bar_height_landscape">28dp</dimen> + +</resources> diff --git a/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/Android.mk b/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/Android.mk new file mode 100644 index 00000000..a9c333a3 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/Android.mk @@ -0,0 +1,31 @@ +# +# Copyright 2023, 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. +# + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_RRO_THEME := SystemUIEmulationPixel8 + +LOCAL_PRODUCT_MODULE := true + +LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res + +LOCAL_PACKAGE_NAME := SystemUIEmulationPixel8Overlay +LOCAL_SDK_VERSION := current + +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +include $(BUILD_RRO_PACKAGE) diff --git a/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/AndroidManifest.xml b/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/AndroidManifest.xml new file mode 100644 index 00000000..2280d7b0 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/AndroidManifest.xml @@ -0,0 +1,24 @@ +<!-- +/** + * Copyright (c) 2023, 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.systemui.emulation.pixel_8" + android:versionCode="1" + android:versionName="1.0"> + <overlay android:targetPackage="com.android.systemui" android:priority="1"/> + <application android:label="Filled" android:hasCode="false"/> +</manifest> diff --git a/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/res/drawable/rounded_corner_bottom.xml b/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/res/drawable/rounded_corner_bottom.xml new file mode 100644 index 00000000..229e6ed2 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/res/drawable/rounded_corner_bottom.xml @@ -0,0 +1,23 @@ +<!-- + Copyright (C) 2023 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="128px" + android:height="128px" + android:viewportWidth="21.596" + android:viewportHeight="21.596"> + <path + android:fillColor="#FF000000" + android:pathData="m0,21.596C0,18.555 -0.037,15.711 0.702,12.7c0.718,-2.927 2.092,-5.593 4.247,-7.749C7.105,2.796 9.772,1.421 12.699,0.703 15.711,-0.037 18.555,0 21.596,0H0v21.595Z"/> +</vector> + diff --git a/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/res/drawable/rounded_corner_top.xml b/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/res/drawable/rounded_corner_top.xml new file mode 100644 index 00000000..229e6ed2 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/res/drawable/rounded_corner_top.xml @@ -0,0 +1,23 @@ +<!-- + Copyright (C) 2023 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="128px" + android:height="128px" + android:viewportWidth="21.596" + android:viewportHeight="21.596"> + <path + android:fillColor="#FF000000" + android:pathData="m0,21.596C0,18.555 -0.037,15.711 0.702,12.7c0.718,-2.927 2.092,-5.593 4.247,-7.749C7.105,2.796 9.772,1.421 12.699,0.703 15.711,-0.037 18.555,0 21.596,0H0v21.595Z"/> +</vector> + diff --git a/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/res/values/config.xml b/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/res/values/config.xml new file mode 100644 index 00000000..5aa8b46f --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/res/values/config.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2023, 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> + <!-- 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. + --> + <!-- Configure 13px of extra protection around the front-facing camera --> + <string translatable="false" name="config_frontBuiltInDisplayCutoutProtection"> + m 589,65.75 a 49.25,49.25 0 0 0 -98.5,0 49.25,49.25 0 0 0 98.5,0 z + </string> + + <!-- Camera 1 is the front camera --> + <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> diff --git a/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/res/values/dimens.xml b/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/res/values/dimens.xml new file mode 100644 index 00000000..dbb961d1 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8/SystemUIOverlay/res/values/dimens.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (c) 2023, 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">16dp</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 volume up/down buttons. --> + <dimen name="physical_volume_up_button_center_screen_location_y">1000px</dimen> + <dimen name="physical_volume_down_button_center_screen_location_y">1160px</dimen> + + <!-- Padding for the lock icon on the keyguard. In pixels - should not scale with + display size. --> + <dimen name="lock_icon_padding">50px</dimen> + + <!-- Offset should not be more than 1mm --> + <dimen name="udfps_burn_in_offset_x">6px</dimen> + <dimen name="udfps_burn_in_offset_y">17px</dimen> + +</resources> diff --git a/overlay/frameworks/base/packages/overlays/pixel_8_pro/AndroidOverlay/Android.mk b/overlay/frameworks/base/packages/overlays/pixel_8_pro/AndroidOverlay/Android.mk new file mode 100644 index 00000000..51261b33 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8_pro/AndroidOverlay/Android.mk @@ -0,0 +1,31 @@ +# +# Copyright 2023, 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. +# + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_RRO_THEME := EmulationPixel8Pro + +LOCAL_PRODUCT_MODULE := true + +LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res + +LOCAL_PACKAGE_NAME := EmulationPixel8ProOverlay +LOCAL_SDK_VERSION := current + +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +include $(BUILD_RRO_PACKAGE) diff --git a/overlay/frameworks/base/packages/overlays/pixel_8_pro/AndroidOverlay/AndroidManifest.xml b/overlay/frameworks/base/packages/overlays/pixel_8_pro/AndroidOverlay/AndroidManifest.xml new file mode 100644 index 00000000..9ae38775 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8_pro/AndroidOverlay/AndroidManifest.xml @@ -0,0 +1,24 @@ +<!-- +/** + * Copyright (c) 2023, 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.emulation.pixel_8_pro" + android:versionCode="1" + android:versionName="1.0"> + <overlay android:targetPackage="android" android:priority="1"/> + <application android:label="Filled" android:hasCode="false"/> +</manifest> diff --git a/overlay/frameworks/base/packages/overlays/pixel_8_pro/AndroidOverlay/res/values/config.xml b/overlay/frameworks/base/packages/overlays/pixel_8_pro/AndroidOverlay/res/values/config.xml new file mode 100644 index 00000000..7eb20d74 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8_pro/AndroidOverlay/res/values/config.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2023, 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"> + <!-- 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). + --> + <!-- 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">1344</integer> + <integer name="config_stableDeviceDisplayHeight">2992</integer> + + + <!-- 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 628.75,75 + a 43.25,43.25 0 1 0 86.5,0 + a 43.25,43.25 0 1 0 -86.5,0 + Z + @left + </string> + + <string translatable="false" name="config_mainBuiltInDisplayCutoutRectApproximation"> + M 615.5,0 + h 110 + v 151 + h -110 + 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" translatable="false">M 119.9999 -3.7795276e-05 C 113.32402 0.34316186 102.8311 1.9200038 98.695215 2.8066029 C 73.98156 8.0987976 62.561448 13.566009 49.605371 22.5859 C 34.411306 33.163789 20.551075 49.59161 12.962793 65.706994 C 7.8660073 76.530983 2.8411097 93.439401 1.4120111 104.32809 C 0.066002501 114.58638 0.28550144 114.76397 -9.8267718e-05 119.99996 L -9.8267718e-05 2877 L 1.9803705 2891.3164 C 8.0676544 2919.9453 16.781085 2937.4625 33.785058 2955.2598 C 51.142521 2973.4268 70.876659 2983.6798 100.6835 2990.0176 L 114.9999 2992 L 1228.9999 2992 L 1243.3163 2990.0176 C 1273.1232 2983.6798 1292.8573 2973.4268 1310.2148 2955.2598 C 1327.2186 2937.4625 1335.9323 2919.9453 1342.0194 2891.3164 L 1343.9999 2877 L 1343.9999 119.99996 C 1343.7143 114.76397 1343.9338 114.58638 1342.5878 104.32809 C 1341.1587 93.439401 1336.1338 76.530983 1331.037 65.706994 C 1323.4487 49.59161 1309.5885 33.163789 1294.3944 22.5859 C 1281.4385 13.566009 1270.0183 8.0987976 1245.3046 2.8066029 C 1241.1687 1.9200038 1230.6758 0.34316186 1223.9999 -3.7795276e-05 L 119.9999 -3.7795276e-05 z</string> + +</resources> diff --git a/overlay/frameworks/base/packages/overlays/pixel_8_pro/AndroidOverlay/res/values/dimens.xml b/overlay/frameworks/base/packages/overlays/pixel_8_pro/AndroidOverlay/res/values/dimens.xml new file mode 100644 index 00000000..bc6c6903 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8_pro/AndroidOverlay/res/values/dimens.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (c) 2023, 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">91px</dimen> + <dimen name="rounded_corner_radius_top">91px</dimen> + <dimen name="rounded_corner_radius_bottom">91px</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">151px</dimen> + <dimen name="status_bar_height_landscape">28dp</dimen> + + +</resources> diff --git a/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/Android.mk b/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/Android.mk new file mode 100644 index 00000000..232491e0 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/Android.mk @@ -0,0 +1,31 @@ +# +# Copyright 2023, 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. +# + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_RRO_THEME := SystemUIEmulationPixel8Pro + +LOCAL_PRODUCT_MODULE := true + +LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res + +LOCAL_PACKAGE_NAME := SystemUIEmulationPixel8ProOverlay +LOCAL_SDK_VERSION := current + +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +include $(BUILD_RRO_PACKAGE) diff --git a/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/AndroidManifest.xml b/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/AndroidManifest.xml new file mode 100644 index 00000000..2227f301 --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/AndroidManifest.xml @@ -0,0 +1,24 @@ +<!-- +/** + * Copyright (c) 2023, 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.systemui.emulation.pixel_8_pro" + android:versionCode="1" + android:versionName="1.0"> + <overlay android:targetPackage="com.android.systemui" android:priority="1"/> + <application android:label="Filled" android:hasCode="false"/> +</manifest> diff --git a/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/res/drawable/rounded_corner_bottom.xml b/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/res/drawable/rounded_corner_bottom.xml new file mode 100644 index 00000000..379aa25b --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/res/drawable/rounded_corner_bottom.xml @@ -0,0 +1,22 @@ +<!-- + Copyright (C) 2023 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="146.5px" + android:height="146.5px" + android:viewportWidth="21.56" + android:viewportHeight="21.56"> + <path + android:fillColor="#000000" + android:pathData="m0,21.56C0,18.524 -0.037,15.685 0.701,12.679c0.717,-2.922 2.089,-5.584 4.241,-7.736C7.093,2.791 9.755,1.419 12.678,0.701 15.684,-0.037 18.524,0 21.56,0H0v21.559Z"/> +</vector> diff --git a/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/res/drawable/rounded_corner_top.xml b/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/res/drawable/rounded_corner_top.xml new file mode 100644 index 00000000..379aa25b --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/res/drawable/rounded_corner_top.xml @@ -0,0 +1,22 @@ +<!-- + Copyright (C) 2023 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="146.5px" + android:height="146.5px" + android:viewportWidth="21.56" + android:viewportHeight="21.56"> + <path + android:fillColor="#000000" + android:pathData="m0,21.56C0,18.524 -0.037,15.685 0.701,12.679c0.717,-2.922 2.089,-5.584 4.241,-7.736C7.093,2.791 9.755,1.419 12.678,0.701 15.684,-0.037 18.524,0 21.56,0H0v21.559Z"/> +</vector> diff --git a/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/res/values/config.xml b/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/res/values/config.xml new file mode 100644 index 00000000..01a30aec --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/res/values/config.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2023, 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> + <!-- Configure 13px of extra protection around the front-facing camera --> + <string translatable="false" name="config_frontBuiltInDisplayCutoutProtection"> + M 613.5,75.5 + a 58,58 0 0 1 116,0 + a 58,58 0 0 1 -116,0 + Z + </string> + + <!-- Camera 1 is the front camera --> + <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> diff --git a/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/res/values/dimens.xml b/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/res/values/dimens.xml new file mode 100644 index 00000000..fe55c16d --- /dev/null +++ b/overlay/frameworks/base/packages/overlays/pixel_8_pro/SystemUIOverlay/res/values/dimens.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (c) 2023, 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> + <dimen name="status_bar_padding_start">16dp</dimen> + <!-- Location on the screen of the center of the physical power button. --> + <dimen name="physical_power_button_center_screen_location_y">774px</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">1040px</dimen> + <dimen name="physical_volume_down_button_center_screen_location_y">1174px</dimen> + + <!-- Padding for the lock icon on the keyguard. In pixels - should not scale with + display size. --> + <dimen name="lock_icon_padding">57px</dimen> +</resources> diff --git a/overlay/frameworks/base/packages/overlays/pixel_fold/AndroidOverlay/res/values/config.xml b/overlay/frameworks/base/packages/overlays/pixel_fold/AndroidOverlay/res/values/config.xml index 04130694..6d6f0035 100644 --- a/overlay/frameworks/base/packages/overlays/pixel_fold/AndroidOverlay/res/values/config.xml +++ b/overlay/frameworks/base/packages/overlays/pixel_fold/AndroidOverlay/res/values/config.xml @@ -46,6 +46,21 @@ @left </string> + <!-- WindowsManager JetPack display features --> + <string name="config_display_features" translatable="false">fold-[1104,0,1104,1848]</string> + + <!-- Map of DeviceState to rotation lock setting. Each entry must be in the format "key:value", + or "key:value:fallback_key" for example: "0:1" or "2:0:1". The keys are device states, and + the values are one of Settings.Secure.DeviceStateRotationLockSetting. + The fallback is a key to a device state that can be specified when the value is + Settings.Secure.DEVICE_STATE_ROTATION_LOCK_IGNORED. + --> + <string-array name="config_perDeviceStateRotationLockDefaults" translatable="false"> + <item>0:1</item> <!-- CLOSED -> LOCKED --> + <item>2:0:1</item> <!-- HALF_OPENED -> IGNORED and fallback to device state OPENED --> + <item>1:2</item> <!-- OPENED -> UNLOCKED --> + </string-array> + <!-- Map of System DeviceState supplied by DeviceStateManager to WM Jetpack posture. --> <string-array name="config_device_state_postures" translatable="false"> <item>0:1</item> <!-- CLOSED --> @@ -91,18 +106,8 @@ This launcher package must have an activity that supports multiple instances and has corresponding launch mode set in AndroidManifest. {@see android.view.Display#FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS} --> - <string name="config_secondaryHomePackage" translatable="false">com.android.launcher3</string> <!-- The device states (supplied by DeviceStateManager) that should be treated as folded by the display fold controller. --> - <dimen name="rounded_corner_content_padding">50px</dimen> - <dimen name="rounded_corner_radius">25px</dimen> - <dimen name="rounded_corner_radius_adjustment">5px</dimen> - <dimen name="rounded_corner_radius_top">52px</dimen> - <dimen name="rounded_corner_radius_bottom">48px</dimen> - <dimen name="secondary_rounded_corner_radius_top">91px</dimen> - <dimen name="secondary_rounded_corner_radius_bottom">91px</dimen> - <dimen name="rounded_corner_radius_top_adjustment">5px</dimen> - <dimen name="rounded_corner_radius_bottom_adjustment">4px</dimen> </resources> diff --git a/sensors/Android.bp b/sensors/Android.bp index c86ecebc..e971f8ea 100644 --- a/sensors/Android.bp +++ b/sensors/Android.bp @@ -23,17 +23,29 @@ package { default_applicable_licenses: ["device_generic_goldfish_license"], } -cc_library_shared { - name: "android.hardware.sensors@2.1-impl.ranchu", - vendor: true, - relative_install_path: "hw", - defaults: ["hidl_defaults"], +filegroup { + name: "android.hardware.sensors@2.1-impl.virtual_srcs", srcs: [ "multihal_sensors.cpp", "multihal_sensors_epoll.cpp", "multihal_sensors_qemu.cpp", "sensor_list.cpp", - "entry.cpp" + ] +} + +cc_library_headers { + name: "android.hardware.sensors@2.1-impl.virtual_headers", + vendor_available: true, + export_include_dirs: ["include"], +} + +cc_defaults { + name: "android.hardware.sensors@2.1-impl.virtual.defaults", + vendor: true, + relative_install_path: "hw", + defaults: ["hidl_defaults"], + srcs: [ + ":android.hardware.sensors@2.1-impl.virtual_srcs", ], shared_libs: [ "android.hardware.sensors@2.0", @@ -44,8 +56,19 @@ cc_library_shared { "liblog", "libutils", ], + header_libs: [ + "android.hardware.sensors@2.X-multihal.header", + "android.hardware.sensors@2.1-impl.virtual_headers" + ], +} + +cc_library_shared { + name: "android.hardware.sensors@2.1-impl.ranchu", + defaults: ["android.hardware.sensors@2.1-impl.virtual.defaults"], + srcs: [ + "entry.cpp" + ], static_libs: ["libqemud.ranchu"], - header_libs: ["android.hardware.sensors@2.X-multihal.header"], cflags: [ "-DLOG_TAG=\"android.hardware.sensors@2.1-impl.ranchu\"", "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION", diff --git a/sensors/entry.cpp b/sensors/entry.cpp index d48c458a..170f3fc2 100644 --- a/sensors/entry.cpp +++ b/sensors/entry.cpp @@ -14,14 +14,47 @@ * limitations under the License. */ -#include <log/log.h> -#include "multihal_sensors.h" +#include <android-base/unique_fd.h> +#include <qemud.h> +#include <multihal_sensors.h> +using ::android::base::unique_fd; using ::android::hardware::sensors::V2_1::implementation::ISensorsSubHal; namespace { -goldfish::MultihalSensors impl; -} + +class QemudSensorsTransport : public goldfish::SensorsTransport { + public: + QemudSensorsTransport() + : m_qemuSensorsFd(qemud_channel_open("sensors")) {} + + int Send(const void* msg, int size) override { + return qemud_channel_send(m_qemuSensorsFd.get(), msg, size); + } + + int Receive(void* msg, int maxsize) override { + return qemud_channel_recv(m_qemuSensorsFd.get(), msg, maxsize); + } + + bool Ok() const override { + return m_qemuSensorsFd.ok(); + } + + int Fd() const override { + return m_qemuSensorsFd.get(); + } + + const char* Name() const override { + return "qemud_channel"; + } + + private: + const unique_fd m_qemuSensorsFd; +}; + +goldfish::MultihalSensors impl([](){ return std::make_unique<QemudSensorsTransport>(); }); + +} // namespace extern "C" ISensorsSubHal* sensorsHalGetSubHal_2_1(uint32_t* version) { *version = SUB_HAL_2_1_VERSION; diff --git a/sensors/multihal_sensors.h b/sensors/include/multihal_sensors.h index 3f242f24..1f50b0bc 100644 --- a/sensors/multihal_sensors.h +++ b/sensors/include/multihal_sensors.h @@ -18,6 +18,7 @@ #include <android-base/unique_fd.h> #include <V2_1/SubHal.h> #include <atomic> +#include <functional> #include <condition_variable> #include <cstdint> #include <random> @@ -25,6 +26,8 @@ #include <thread> #include <vector> +#include "multihal_sensors_transport.h" + namespace goldfish { namespace ahs = ::android::hardware::sensors; namespace ahs21 = ahs::V2_1; @@ -47,7 +50,9 @@ using ::android::hardware::Return; using ::android::sp; struct MultihalSensors : public ahs21::implementation::ISensorsSubHal { - MultihalSensors(); + using SensorsTransportFactory = std::function<std::unique_ptr<SensorsTransport>()>; + + MultihalSensors(SensorsTransportFactory); ~MultihalSensors(); Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& args) override; @@ -75,6 +80,7 @@ struct MultihalSensors : public ahs21::implementation::ISensorsSubHal { private: struct QemuSensorsProtocolState { int64_t timeBiasNs = -500000000; + int32_t sensorsUpdateIntervalMs = 200; static constexpr float kSensorNoValue = -1e+30; @@ -95,24 +101,30 @@ private: return m_activeSensorsMask & (1u << sensorHandle); // m_mtx required } Event activationOnChangeSensorEvent(int32_t sensorHandle, const SensorInfo& sensor) const; - static bool activateQemuSensorImpl(int pipe, int sensorHandle, bool enabled); - bool setAllQemuSensors(bool enabled); - void parseQemuSensorEventLocked(const int pipe, QemuSensorsProtocolState* state); + static bool setSensorsReportingImpl(SensorsTransport& st, int sensorHandle, bool enabled); + static bool setAllSensorsReporting(SensorsTransport& st, + uint32_t availableSensorsMask, bool enabled); + static bool setSensorsGuestTime(SensorsTransport& st, int64_t value); + static bool setSensorsUpdateIntervalMs(SensorsTransport& st, uint32_t value); + void parseQemuSensorEventLocked(QemuSensorsProtocolState* state); void postSensorEventLocked(const Event& event); void doPostSensorEventLocked(const SensorInfo& sensor, const Event& event); void setAdditionalInfoFrames(); void sendAdditionalInfoReport(int sensorHandle); + bool qemuSensorListenerThreadImpl(int transportFd); void qemuSensorListenerThread(); void batchThread(); double randomError(float lo, float hi); static constexpr char kCMD_QUIT = 'q'; + static constexpr char kCMD_RESTART = 'r'; bool qemuSensorThreadSendCommand(char cmd) const; - // set in ctor, never change - const unique_fd m_qemuSensorsFd; + const SensorsTransportFactory m_sensorsTransportFactory; + SensorsTransport* m_sensorsTransport; + uint32_t m_availableSensorsMask = 0; // a pair of connected sockets to talk to the worker thread unique_fd m_callersFd; // a caller writes here diff --git a/sensors/include/multihal_sensors_transport.h b/sensors/include/multihal_sensors_transport.h new file mode 100644 index 00000000..d5de1501 --- /dev/null +++ b/sensors/include/multihal_sensors_transport.h @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2023 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. + */ + +#pragma once + +namespace goldfish { + +class SensorsTransport { + public: + virtual int Send(const void* msg, int size) = 0; + virtual int Receive(void* msg, int maxsize) = 0; + virtual bool Ok() const = 0; + virtual int Fd() const = 0; + virtual const char* Name() const = 0; + + virtual ~SensorsTransport() = default; +}; + +} // namespace goldfish diff --git a/sensors/multihal_sensors.cpp b/sensors/multihal_sensors.cpp index 41c7f42f..beb34d92 100644 --- a/sensors/multihal_sensors.cpp +++ b/sensors/multihal_sensors.cpp @@ -14,11 +14,10 @@ * limitations under the License. */ -#include <cinttypes> +#include <cstdint> #include <log/log.h> -#include <qemud.h> #include <utils/SystemClock.h> -#include "multihal_sensors.h" +#include <multihal_sensors.h> #include "sensor_list.h" namespace goldfish { @@ -31,58 +30,54 @@ using ahs10::AdditionalInfoType; namespace { constexpr int64_t kMaxSamplingPeriodNs = 1000000000; + +struct SensorsTransportStub : public SensorsTransport { + int Send(const void*, int) override { return -1; } + int Receive(void*, int) override { return -1; } + bool Ok() const override { return false; } + int Fd() const override { return -1; } + const char* Name() const override { return "stub"; } +}; + +const SensorsTransportStub g_sensorsTransportStub; } -MultihalSensors::MultihalSensors() - : m_qemuSensorsFd(qemud_channel_open("sensors")) +MultihalSensors::MultihalSensors(SensorsTransportFactory stf) + : m_sensorsTransportFactory(std::move(stf)) + , m_sensorsTransport(const_cast<SensorsTransportStub*>(&g_sensorsTransportStub)) , m_batchInfo(getSensorNumber()) { - if (!m_qemuSensorsFd.ok()) { - ALOGE("%s:%d: m_qemuSensorsFd is not opened", __func__, __LINE__); - ::abort(); - } + { + const auto st = m_sensorsTransportFactory(); - char buffer[64]; - int len = snprintf(buffer, sizeof(buffer), - "time:%" PRId64, ::android::elapsedRealtimeNano()); - if (qemud_channel_send(m_qemuSensorsFd.get(), buffer, len) < 0) { - ALOGE("%s:%d: qemud_channel_send failed", __func__, __LINE__); - ::abort(); - } + LOG_ALWAYS_FATAL_IF(!st->Ok(), "%s:%d: sensors transport is not opened", + __func__, __LINE__); - using namespace std::literals; - const std::string_view kListSensorsCmd = "list-sensors"sv; + using namespace std::literals; + const std::string_view kListSensorsCmd = "list-sensors"sv; - if (qemud_channel_send(m_qemuSensorsFd.get(), - kListSensorsCmd.data(), - kListSensorsCmd.size()) < 0) { - ALOGE("%s:%d: qemud_channel_send failed", __func__, __LINE__); - ::abort(); - } + LOG_ALWAYS_FATAL_IF(st->Send(kListSensorsCmd.data(), kListSensorsCmd.size()) < 0, + "%s:%d: send for %s failed", __func__, __LINE__, st->Name()); - len = qemud_channel_recv(m_qemuSensorsFd.get(), buffer, sizeof(buffer) - 1); - if (len < 0) { - ALOGE("%s:%d: qemud_channel_recv failed", __func__, __LINE__); - ::abort(); - } - buffer[len] = 0; - uint32_t hostSensorsMask = 0; - if (sscanf(buffer, "%u", &hostSensorsMask) != 1) { - ALOGE("%s:%d: Can't parse qemud response", __func__, __LINE__); - ::abort(); - } + char buffer[64]; + const int len = st->Receive(buffer, sizeof(buffer) - 1); + LOG_ALWAYS_FATAL_IF(len < 0, "%s:%d: receive for %s failed", __func__, __LINE__, + st->Name()); - m_availableSensorsMask = hostSensorsMask - & ((1u << getSensorNumber()) - 1); + buffer[len] = 0; + uint32_t hostSensorsMask = 0; + LOG_ALWAYS_FATAL_IF(sscanf(buffer, "%u", &hostSensorsMask) != 1, + "%s:%d: Can't parse qemud response", __func__, __LINE__); - ALOGI("%s:%d: host sensors mask=%x, available sensors mask=%x", - __func__, __LINE__, hostSensorsMask, m_availableSensorsMask); + m_availableSensorsMask = hostSensorsMask & ((1u << getSensorNumber()) - 1); - if (!::android::base::Socketpair(AF_LOCAL, SOCK_STREAM, 0, - &m_callersFd, &m_sensorThreadFd)) { - ALOGE("%s:%d: Socketpair failed", __func__, __LINE__); - ::abort(); + ALOGI("%s:%d: host sensors mask=%x, available sensors mask=%x", + __func__, __LINE__, hostSensorsMask, m_availableSensorsMask); } + LOG_ALWAYS_FATAL_IF(!::android::base::Socketpair(AF_LOCAL, SOCK_STREAM, 0, + &m_callersFd, &m_sensorThreadFd), + "%s:%d: Socketpair failed", __func__, __LINE__); + setAdditionalInfoFrames(); m_sensorThread = std::thread(&MultihalSensors::qemuSensorListenerThread, this); @@ -90,8 +85,6 @@ MultihalSensors::MultihalSensors() } MultihalSensors::~MultihalSensors() { - setAllQemuSensors(false); - m_batchRunning = false; m_batchUpdated.notify_one(); m_batchThread.join(); @@ -268,14 +261,10 @@ Return<Result> MultihalSensors::batch(const int32_t sensorHandle, activeSensorsMask >>= 1; } - const int delayMs = std::max(1, int(minSamplingPeriodNs / 1000000)); - - char buffer[64]; - const int len = snprintf(buffer, sizeof(buffer), "set-delay:%d", delayMs); - - if (qemud_channel_send(m_qemuSensorsFd.get(), buffer, len) < 0) { - ALOGE("%s:%d: qemud_channel_send failed", __func__, __LINE__); - ::abort(); + const uint32_t sensorsUpdateIntervalMs = std::max(1, int(minSamplingPeriodNs / 1000000)); + m_protocolState.sensorsUpdateIntervalMs = sensorsUpdateIntervalMs; + if (!setSensorsUpdateIntervalMs(*m_sensorsTransport, sensorsUpdateIntervalMs)) { + qemuSensorThreadSendCommand(kCMD_RESTART); } } @@ -330,7 +319,6 @@ Return<Result> MultihalSensors::injectSensorData_2_1(const Event& event) { Return<Result> MultihalSensors::initialize(const sp<IHalProxyCallback>& halProxyCallback) { std::unique_lock<std::mutex> lock(m_mtx); - setAllQemuSensors(true); // we need to start sampling sensors for batching m_opMode = OperationMode::NORMAL; m_halProxyCallback = halProxyCallback; return Result::OK; @@ -418,6 +406,35 @@ bool MultihalSensors::isSensorHandleValid(int sensorHandle) const { return true; } +void MultihalSensors::qemuSensorListenerThread() { + while (true) { + const auto st = m_sensorsTransportFactory(); + + LOG_ALWAYS_FATAL_IF(!setSensorsGuestTime( + *st, ::android::elapsedRealtimeNano())); + LOG_ALWAYS_FATAL_IF(!setSensorsUpdateIntervalMs( + *st, m_protocolState.sensorsUpdateIntervalMs)); + LOG_ALWAYS_FATAL_IF(!setAllSensorsReporting( + *st, m_availableSensorsMask, true)); + + { + std::unique_lock<std::mutex> lock(m_mtx); + m_sensorsTransport = st.get(); + } + + const bool cont = qemuSensorListenerThreadImpl(st->Fd()); + + { + std::unique_lock<std::mutex> lock(m_mtx); + m_sensorsTransport = const_cast<SensorsTransportStub*>(&g_sensorsTransportStub); + } + + if (!cont) { + break; + } + } +} + void MultihalSensors::batchThread() { while (m_batchRunning) { std::unique_lock<std::mutex> lock(m_mtx); diff --git a/sensors/multihal_sensors_epoll.cpp b/sensors/multihal_sensors_epoll.cpp index 63b978ac..5ce6eb6a 100644 --- a/sensors/multihal_sensors_epoll.cpp +++ b/sensors/multihal_sensors_epoll.cpp @@ -38,14 +38,12 @@ int qemuSensortThreadRcvCommand(const int fd) { } } // namespace -void MultihalSensors::qemuSensorListenerThread() { +bool MultihalSensors::qemuSensorListenerThreadImpl(const int transportFd) { const unique_fd epollFd(epoll_create1(0)); - if (!epollFd.ok()) { - ALOGE("%s:%d: epoll_create1 failed", __func__, __LINE__); - ::abort(); - } + LOG_ALWAYS_FATAL_IF(!epollFd.ok(), "%s:%d: epoll_create1 failed", + __func__, __LINE__); - epollCtlAdd(epollFd.get(), m_qemuSensorsFd.get()); + epollCtlAdd(epollFd.get(), transportFd); epollCtlAdd(epollFd.get(), m_sensorThreadFd.get()); while (true) { @@ -55,9 +53,9 @@ void MultihalSensors::qemuSensorListenerThread() { events, 2, kTimeoutMs)); if (n < 0) { - ALOGE("%s:%d: epoll_wait failed with '%s'", + ALOGW("%s:%d: epoll_wait failed with '%s'", __func__, __LINE__, strerror(errno)); - continue; + return true; } for (int i = 0; i < n; ++i) { @@ -65,33 +63,35 @@ void MultihalSensors::qemuSensorListenerThread() { const int fd = ev->data.fd; const int ev_events = ev->events; - if (fd == m_qemuSensorsFd.get()) { + if (fd == transportFd) { if (ev_events & (EPOLLERR | EPOLLHUP)) { - ALOGE("%s:%d: epoll_wait: devFd has an error, ev_events=%x", - __func__, __LINE__, ev_events); - ::abort(); + ALOGW("%s:%d: epoll_wait: transportFd has an error, " + "ev_events=%x", __func__, __LINE__, ev_events); + return true; } else if (ev_events & EPOLLIN) { std::unique_lock<std::mutex> lock(m_mtx); - parseQemuSensorEventLocked(m_qemuSensorsFd.get(), &m_protocolState); + parseQemuSensorEventLocked(&m_protocolState); } } else if (fd == m_sensorThreadFd.get()) { if (ev_events & (EPOLLERR | EPOLLHUP)) { - ALOGE("%s:%d: epoll_wait: threadsFd has an error, ev_events=%x", - __func__, __LINE__, ev_events); - ::abort(); + LOG_ALWAYS_FATAL("%s:%d: epoll_wait: threadFd has an error, " + "ev_events=%x", __func__, __LINE__, ev_events); } else if (ev_events & EPOLLIN) { const int cmd = qemuSensortThreadRcvCommand(fd); - if (cmd == kCMD_QUIT) { - return; - } else { - ALOGE("%s:%d: qemuSensortThreadRcvCommand returned unexpected command, cmd=%d", + switch (cmd) { + case kCMD_QUIT: return false; + case kCMD_RESTART: return true; + default: + ALOGW("%s:%d: qemuSensortThreadRcvCommand " + "returned unexpected command, cmd=%d", __func__, __LINE__, cmd); - ::abort(); + return true; } } } else { - ALOGE("%s:%d: epoll_wait() returned unexpected fd", + ALOGW("%s:%d: epoll_wait() returned unexpected fd", __func__, __LINE__); + return true; } } } diff --git a/sensors/multihal_sensors_qemu.cpp b/sensors/multihal_sensors_qemu.cpp index 19df6c5a..985612e0 100644 --- a/sensors/multihal_sensors_qemu.cpp +++ b/sensors/multihal_sensors_qemu.cpp @@ -14,12 +14,12 @@ * limitations under the License. */ +#include <cinttypes> #include <log/log.h> #include <utils/SystemClock.h> #include <math.h> -#include <qemud.h> #include <random> -#include "multihal_sensors.h" +#include <multihal_sensors.h> #include "sensor_list.h" namespace goldfish { @@ -53,28 +53,29 @@ int64_t weigthedAverage(const int64_t a, int64_t aw, int64_t b, int64_t bw) { } // namespace -bool MultihalSensors::activateQemuSensorImpl(const int pipe, - const int sensorHandle, - const bool enabled) { +bool MultihalSensors::setSensorsReportingImpl(SensorsTransport& st, + const int sensorHandle, + const bool enabled) { char buffer[64]; int len = snprintf(buffer, sizeof(buffer), "set:%s:%d", getQemuSensorNameByHandle(sensorHandle), (enabled ? 1 : 0)); - if (qemud_channel_send(pipe, buffer, len) < 0) { - ALOGE("%s:%d: qemud_channel_send failed", __func__, __LINE__); + if (st.Send(buffer, len) < 0) { + ALOGE("%s:%d: send for %s failed", __func__, __LINE__, st.Name()); return false; } else { return true; } } -bool MultihalSensors::setAllQemuSensors(const bool enabled) { - uint32_t mask = m_availableSensorsMask; - for (int i = 0; mask; ++i, mask >>= 1) { - if (mask & 1) { - if (!activateQemuSensorImpl(m_qemuSensorsFd.get(), i, enabled)) { +bool MultihalSensors::setAllSensorsReporting(SensorsTransport& st, + uint32_t availableSensorsMask, + const bool enabled) { + for (int i = 0; availableSensorsMask; ++i, availableSensorsMask >>= 1) { + if (availableSensorsMask & 1) { + if (!setSensorsReportingImpl(st, i, enabled)) { return false; } } @@ -83,17 +84,39 @@ bool MultihalSensors::setAllQemuSensors(const bool enabled) { return true; } +bool MultihalSensors::setSensorsGuestTime(SensorsTransport& st, const int64_t value) { + char buffer[64]; + int len = snprintf(buffer, sizeof(buffer), "time:%" PRId64, value); + if (st.Send(buffer, len) < 0) { + ALOGE("%s:%d: send for %s failed", __func__, __LINE__, st.Name()); + return false; + } else { + return true; + } +} + +bool MultihalSensors::setSensorsUpdateIntervalMs(SensorsTransport& st, + const uint32_t intervalMs) { + char buffer[64]; + const int len = snprintf(buffer, sizeof(buffer), "set-delay:%u", intervalMs); + if (st.Send(buffer, len) < 0) { + ALOGE("%s:%d: send for %s failed", __func__, __LINE__, st.Name()); + return false; + } else { + return true; + } +} + double MultihalSensors::randomError(float lo, float hi) { std::uniform_real_distribution<> distribution(lo, hi); return distribution(gen); } -void MultihalSensors::parseQemuSensorEventLocked(const int pipe, - QemuSensorsProtocolState* state) { +void MultihalSensors::parseQemuSensorEventLocked(QemuSensorsProtocolState* state) { char buf[256]; - const int len = qemud_channel_recv(pipe, buf, sizeof(buf) - 1); + const int len = m_sensorsTransport->Receive(buf, sizeof(buf) - 1); if (len < 0) { - ALOGE("%s:%d: qemud_channel_recv failed", __func__, __LINE__); + ALOGE("%s:%d: receive for %s failed", __func__, __LINE__, m_sensorsTransport->Name()); } const int64_t nowNs = ::android::elapsedRealtimeNano(); buf[len] = 0; diff --git a/tablet/data/etc/display_settings.xml b/tablet/data/etc/display_settings.xml new file mode 100644 index 00000000..7808e5a5 --- /dev/null +++ b/tablet/data/etc/display_settings.xml @@ -0,0 +1,8 @@ +<?xml version='1.0' encoding='utf-8' standalone='yes' ?> +<display-settings> + <config identifier="0" /> + <!-- Allow rotation of fixed-orientation activities on the tablet. --> + <display + name="local:4619827259835644672" + ignoreOrientationRequest="true"/> +</display-settings> diff --git a/tablet/data/etc/tablet.xml b/tablet/data/etc/tablet.xml index 002af906..7e93c5cb 100644 --- a/tablet/data/etc/tablet.xml +++ b/tablet/data/etc/tablet.xml @@ -17,4 +17,6 @@ <permissions> <!-- Do not support autofocus in tablet devices. --> <unavailable-feature name="android.hardware.camera.autofocus" /> + <!-- Do not support hinge angle sensors in tablet devices. --> + <unavailable-feature name="android.hardware.sensor.hinge_angle" /> </permissions> diff --git a/tablet/overlay/frameworks/base/core/res/res/values/config.xml b/tablet/overlay/frameworks/base/core/res/res/values/config.xml new file mode 100644 index 00000000..08cbf925 --- /dev/null +++ b/tablet/overlay/frameworks/base/core/res/res/values/config.xml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2017, 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"> + <!-- Make this 'true' to allow the Emulator to control + the state of the headphone/microphone jack --> + <bool name="config_useDevInputEventForAudioJack">true</bool> + + <!-- Maximum number of supported users --> + <integer name="config_multiuserMaximumUsers">4</integer> + <!-- Whether Multiuser UI should be shown --> + <bool name="config_enableMultiUserUI">true</bool> + + <integer name="config_deskDockRotation">0</integer> + + + <!-- Indicate whether closing the lid causes the device to enter the folded state which means + to get a smaller screen and opening the lid causes the device to enter the unfolded state + which means to get a larger screen. --> + <bool name="config_lidControlsDisplayFold">true</bool> + + <!-- Allow testing SoftAP using the simulated interfaces on the emulator. --> + <string-array name="config_tether_wifi_regexs"> + <item>"wlan\\d"</item> + </string-array> + + + + <!-- This device is able to support the microphone and camera global toggles. --> + <bool name="config_supportsMicToggle">true</bool> + <bool name="config_supportsCamToggle">true</bool> + <!-- Specifies priority of automatic time sources. Suggestions from higher entries in the list + take precedence over lower ones. + See com.android.server.timedetector.TimeDetectorStrategy for available sources. --> + <string-array name="config_autoTimeSourcesPriority"> + <item>telephony</item> + <item>network</item> + </string-array> + + + <bool name="config_supportMicNearUltrasound">true</bool> + <bool name="config_supportSpeakerNearUltrasound">true</bool> + +</resources> diff --git a/tablet/overlay/frameworks/base/core/res/res/xml/irq_device_map.xml b/tablet/overlay/frameworks/base/core/res/res/xml/irq_device_map.xml new file mode 100644 index 00000000..09d7a88b --- /dev/null +++ b/tablet/overlay/frameworks/base/core/res/res/xml/irq_device_map.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +** +** Copyright 2023, 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. +*/ +--> +<irq-device-map> + <device name="rtc0"> + <subsystem>Alarm</subsystem> + </device> +</irq-device-map> diff --git a/tablet/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/tablet/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml new file mode 100644 index 00000000..7b206e46 --- /dev/null +++ b/tablet/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/** + * Copyright (c) 2015, 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> + <bool name="def_lockscreen_disabled">true</bool> + <bool name="def_wifi_on">true</bool> + <!-- Allow scanning even if WiFi is disabled --> + <integer name="def_wifi_scan_always_available">1</integer> + + <!-- maximize the timeout to INT_MAX about 500+ hours --> + <integer name="def_screen_off_timeout">2147483647</integer> + + <!-- Allow users to use both the on-screen keyboard, as well as a real + keyboard --> + <bool name="def_show_ime_with_hard_keyboard">true</bool> +</resources> diff --git a/tasks/emu_img_zip.mk b/tasks/emu_img_zip.mk index bdfe7594..dc5e502a 100644 --- a/tasks/emu_img_zip.mk +++ b/tasks/emu_img_zip.mk @@ -45,7 +45,7 @@ INTERNAL_EMULATOR_PACKAGE_FILES += device/generic/goldfish/data/etc/encryptionke INTERNAL_EMULATOR_PACKAGE_FILES += device/generic/goldfish/data/etc/userdata.img INTERNAL_EMULATOR_FEATURE_DIR := . -ifneq ($(filter sdk_phone64_% sdk_gphone64_%, $(TARGET_PRODUCT)),) +ifneq ($(filter sdk_phone64_% sdk_gphone64_% sdk_tablet% sdk_gtablet%, $(TARGET_PRODUCT)),) INTERNAL_EMULATOR_FEATURE_DIR := 64bit endif @@ -54,6 +54,10 @@ ifneq ($(filter %_minigbm, $(TARGET_PRODUCT)),) ADVANCED_FEATURES_FILENAME := advancedFeatures.ini.minigbm endif +ifneq ($(filter sdk_tablet% sdk_gtablet%, $(TARGET_PRODUCT)),) +ADVANCED_FEATURES_FILENAME := advancedFeatures.ini.tablet +endif + ADVANCED_FEATURES_FILES := ifeq ($(TARGET_BUILD_VARIANT),user) ADVANCED_FEATURES_FILES += device/generic/goldfish/data/etc/google/$(INTERNAL_EMULATOR_FEATURE_DIR)/user/$(ADVANCED_FEATURES_FILENAME) diff --git a/vendor_common.mk b/vendor_common.mk index 2e3361dd..a0d5479f 100644 --- a/vendor_common.mk +++ b/vendor_common.mk @@ -50,7 +50,6 @@ PRODUCT_VENDOR_PROPERTIES += \ debug.sf.vsync_reactor_ignore_present_fences=true \ debug.stagefright.c2inputsurface=-1 \ debug.stagefright.ccodec=4 \ - graphics.gpu.profiler.support=true \ persist.sys.zram_enabled=1 \ wifi.direct.interface=p2p-dev-wlan0 \ wifi.interface=wlan0 \ @@ -155,10 +154,16 @@ PRODUCT_PACKAGES += \ DisplayCutoutEmulationEmu01Overlay \ EmulationPixelFoldOverlay \ SystemUIEmulationPixelFoldOverlay \ + EmulationPixel8ProOverlay \ + SystemUIEmulationPixel8ProOverlay \ + EmulationPixel8Overlay \ + SystemUIEmulationPixel8Overlay \ EmulationPixel7ProOverlay \ SystemUIEmulationPixel7ProOverlay \ EmulationPixel7Overlay \ SystemUIEmulationPixel7Overlay \ + EmulationPixel7aOverlay \ + SystemUIEmulationPixel7aOverlay \ EmulationPixel6ProOverlay \ SystemUIEmulationPixel6ProOverlay \ EmulationPixel6Overlay \ @@ -216,7 +221,6 @@ PRODUCT_COPY_FILES += \ device/generic/goldfish/camera/media/codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \ device/generic/goldfish/camera/media/codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml \ device/generic/goldfish/camera/media/codecs_performance_c2.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance_c2.xml \ - frameworks/native/data/etc/android.hardware.camera.ar.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.ar.xml \ frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \ frameworks/native/data/etc/android.hardware.camera.concurrent.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.concurrent.xml \ frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \ @@ -334,9 +338,12 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.software.autofill.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.autofill.xml \ frameworks/native/data/etc/android.software.verified_boot.xml:${TARGET_COPY_OUT_PRODUCT}/etc/permissions/android.software.verified_boot.xml \ device/generic/goldfish/data/etc/permissions/privapp-permissions-goldfish.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/privapp-permissions-goldfish.xml \ + device/generic/goldfish/data/etc/permissions/privapp-permissions-multidisplay.xml:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/permissions/privapp-permissions-multidisplay.xml \ +ifneq ($(EMULATOR_DISABLE_RADIO),true) # Android TV ingests this file, but declares its own set of hardware permissions. ifneq ($(PRODUCT_IS_ATV_SDK),true) PRODUCT_COPY_FILES+= \ device/generic/goldfish/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml endif +endif |