From 20814592ea95c41459acb6ff26587204106ddd3f Mon Sep 17 00:00:00 2001 From: yuanruibin Date: Wed, 15 Jan 2025 09:26:46 +0800 Subject: [PATCH 1/7] =?UTF-8?q?A11=E6=9B=B4=E6=96=B0=E5=BC=80=E6=BA=90?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/job/JobSchedulerInternal.java | 2 ++ .../server/job/JobSchedulerService.java | 18 ++++++++++++++++-- .../com/android/server/power/Notifier.java | 19 ------------------- .../server/power/PowerManagerService.java | 2 +- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/aosp/frameworks/base/apex/jobscheduler/framework/java/com/android/server/job/JobSchedulerInternal.java b/aosp/frameworks/base/apex/jobscheduler/framework/java/com/android/server/job/JobSchedulerInternal.java index 7833a0374..d9e56c463 100644 --- a/aosp/frameworks/base/apex/jobscheduler/framework/java/com/android/server/job/JobSchedulerInternal.java +++ b/aosp/frameworks/base/apex/jobscheduler/framework/java/com/android/server/job/JobSchedulerInternal.java @@ -54,6 +54,8 @@ public interface JobSchedulerInternal { */ void reportAppUsage(String packageName, int userId); + void onInteraciveChange(boolean isInteractive); + /** * Report a snapshot of sync-related jobs back to the sync manager */ diff --git a/aosp/frameworks/base/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java b/aosp/frameworks/base/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java index 1e470ce50..e36b35516 100644 --- a/aosp/frameworks/base/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java +++ b/aosp/frameworks/base/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java @@ -222,6 +222,7 @@ public class JobSchedulerService extends com.android.server.SystemService static final int MSG_UID_GONE = 5; static final int MSG_UID_ACTIVE = 6; static final int MSG_UID_IDLE = 7; + static final int MSG_INTERACTIVE_CHANGED = 8; /** * Track Services that have currently active or pending jobs. The index is provided by @@ -284,6 +285,7 @@ public class JobSchedulerService extends com.android.server.SystemService ActivityManagerInternal mActivityManagerInternal; IBatteryStats mBatteryStats; DeviceIdleInternal mLocalDeviceIdleController; + HwInteractiveController mHwInteractiveController; @VisibleForTesting AppStateTracker mAppStateTracker; final UsageStatsManagerInternal mUsageStats; @@ -1448,7 +1450,8 @@ public class JobSchedulerService extends com.android.server.SystemService mControllers.add(mDeviceIdleJobsController); mQuotaController = new QuotaController(this); mControllers.add(mQuotaController); - mControllers.add(new HwInteractiveController(this)); + mHwInteractiveController = new HwInteractiveController(this); + mControllers.add(mHwInteractiveController); mRestrictiveControllers = new ArrayList<>(); mRestrictiveControllers.add(mBatteryController); @@ -1976,7 +1979,11 @@ public class JobSchedulerService extends com.android.server.SystemService } break; } - + case MSG_INTERACTIVE_CHANGED: { + int interactive = message.arg1; + mHwInteractiveController.onInteraciveChange(interactive == 1); + break; + } } maybeRunPendingJobsLocked(); // Don't remove JOB_EXPIRED in case one came along while processing the queue. @@ -2455,6 +2462,13 @@ public class JobSchedulerService extends com.android.server.SystemService return new JobStorePersistStats(mJobs.getPersistStats()); } } + + @Override + public void onInteraciveChange(boolean isInteractive) { + Message msg = mHandler.obtainMessage(MSG_INTERACTIVE_CHANGED); + msg.arg1 = isInteractive ? 1 : 0; + mHandler.sendMessage(msg); + } } /** diff --git a/aosp/frameworks/base/services/core/java/com/android/server/power/Notifier.java b/aosp/frameworks/base/services/core/java/com/android/server/power/Notifier.java index b6a700740..8f0fd607f 100644 --- a/aosp/frameworks/base/services/core/java/com/android/server/power/Notifier.java +++ b/aosp/frameworks/base/services/core/java/com/android/server/power/Notifier.java @@ -96,7 +96,6 @@ public class Notifier { private static final int MSG_WIRELESS_CHARGING_STARTED = 3; private static final int MSG_PROFILE_TIMED_OUT = 5; private static final int MSG_WIRED_CHARGING_STARTED = 6; - private static final int MSG_INTERACTIVE = 7; private static final long[] CHARGING_VIBRATION_TIME = { 40, 40, 40, 40, 40, 40, 40, 40, 40, // ramp-up sampling rate = 40ms @@ -132,8 +131,6 @@ public class Notifier { private final Intent mScreenOnIntent; private final Intent mScreenOffIntent; - private final IHwNotifier mHwNotifier; - // True if the device should suspend when the screen is off due to proximity. private final boolean mSuspendWhenScreenOffDueToProximityConfig; @@ -191,8 +188,6 @@ public class Notifier { Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND | Intent.FLAG_RECEIVER_VISIBLE_TO_INSTANT_APPS); - mHwNotifier = new HwNotifier(mContext, mHandler); - mSuspendWhenScreenOffDueToProximityConfig = context.getResources().getBoolean( com.android.internal.R.bool.config_suspendWhenScreenOffDueToProximity); mShowWirelessChargingAnimationConfig = context.getResources().getBoolean( @@ -451,18 +446,6 @@ public class Notifier { } } - public void onInteraciveChange(boolean isInteractive) { - mHwNotifier.onInteraciveChange(isInteractive); - } - - private void sendNoInteractiveIntent(boolean isInteractive) { - synchronized (mLock) { - if (mActivityManagerInternal.isSystemReady()) { - mHwNotifier.sendNoInteractiveIntent(isInteractive); - } - } - } - /** * Handle early interactive state changes such as getting applications or the lock * screen running and ready for the user to see (such as when turning on the screen). @@ -895,8 +878,6 @@ public class Notifier { case MSG_WIRED_CHARGING_STARTED: showWiredChargingStarted(msg.arg1); break; - case MSG_INTERACTIVE: - sendNoInteractiveIntent(msg.arg1 == 1); } } } diff --git a/aosp/frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java b/aosp/frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java index 8c2984418..8d98f7eaa 100644 --- a/aosp/frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java +++ b/aosp/frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java @@ -2382,7 +2382,7 @@ public final class PowerManagerService extends SystemService || (mUserActivitySummary & (USER_ACTIVITY_SCREEN_BRIGHT | USER_ACTIVITY_SCREEN_DIM)) != 0 || mScreenBrightnessBoostInProgress); - mHwPowerManagerService.checkInteractiveStatusAndNotify(nowKeepInteractive, mNotifier); + mHwPowerManagerService.checkInteractiveStatusAndNotify(nowKeepInteractive); } private void scheduleUserInactivityTimeout(long timeMs) { -- Gitee From bcadf5145da5e3f852fae3d5c1f0847184969fb3 Mon Sep 17 00:00:00 2001 From: yuanruibin Date: Wed, 15 Jan 2025 10:51:36 +0800 Subject: [PATCH 2/7] add drm mk --- .../interfaces/drm/1.0/default/Android.mk | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 aosp/hardware/interfaces/drm/1.0/default/Android.mk diff --git a/aosp/hardware/interfaces/drm/1.0/default/Android.mk b/aosp/hardware/interfaces/drm/1.0/default/Android.mk new file mode 100644 index 000000000..46f04fa51 --- /dev/null +++ b/aosp/hardware/interfaces/drm/1.0/default/Android.mk @@ -0,0 +1,81 @@ +# +# Copyright (C) 2016 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. + + +############# Build legacy drm service ############ + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +include $(LOCAL_PATH)/common_default_service.mk +LOCAL_MODULE := android.hardware.drm@1.0-service +LOCAL_INIT_RC := android.hardware.drm@1.0-service.rc +LOCAL_SRC_FILES := service.cpp + +include $(BUILD_EXECUTABLE) + +############# Build legacy drm lazy service ############ + +include $(CLEAR_VARS) + +include $(LOCAL_PATH)/common_default_service.mk +LOCAL_MODULE := android.hardware.drm@1.0-service-lazy +LOCAL_OVERRIDES_MODULES := android.hardware.drm@1.0-service +LOCAL_INIT_RC := android.hardware.drm@1.0-service-lazy.rc +LOCAL_SRC_FILES := serviceLazy.cpp + +include $(BUILD_EXECUTABLE) + +############# Build legacy drm impl library ############ + +include $(CLEAR_VARS) +LOCAL_MODULE := android.hardware.drm@1.0-impl +LOCAL_PROPRIETARY_MODULE := true +LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_SRC_FILES := \ + DrmFactory.cpp \ + DrmPlugin.cpp \ + CryptoFactory.cpp \ + CryptoPlugin.cpp \ + LegacyPluginPath.cpp \ + TypeConvert.cpp \ + +LOCAL_SHARED_LIBRARIES := \ + android.hardware.drm@1.0 \ + android.hidl.memory@1.0 \ + libcutils \ + libhidlbase \ + libhidlmemory \ + liblog \ + libstagefright_foundation \ + libutils \ + +LOCAL_STATIC_LIBRARIES := \ + android.hardware.drm@1.0-helper \ + +LOCAL_C_INCLUDES := \ + frameworks/native/include \ + frameworks/av/include + +# TODO: Some legacy DRM plugins only support 32-bit. They need to be migrated to +# 64-bit. (b/18948909) Once all of a device's legacy DRM plugins support 64-bit, +# that device can turn on TARGET_ENABLE_MEDIADRM_64 to build this impl as +# 64-bit. +ifneq ($(TARGET_ENABLE_MEDIADRM_64), true) +LOCAL_32_BIT_ONLY := true +endif + +include $(BUILD_SHARED_LIBRARY) -- Gitee From a65fd17a64988f51996c461b1b0205b97ae4eac8 Mon Sep 17 00:00:00 2001 From: yuanruibin Date: Wed, 15 Jan 2025 10:52:22 +0800 Subject: [PATCH 3/7] fix drm passthrough --- aosp/hardware/interfaces/drm/1.0/default/Android.mk | 3 --- 1 file changed, 3 deletions(-) diff --git a/aosp/hardware/interfaces/drm/1.0/default/Android.mk b/aosp/hardware/interfaces/drm/1.0/default/Android.mk index 46f04fa51..0a19aa76c 100644 --- a/aosp/hardware/interfaces/drm/1.0/default/Android.mk +++ b/aosp/hardware/interfaces/drm/1.0/default/Android.mk @@ -74,8 +74,5 @@ LOCAL_C_INCLUDES := \ # 64-bit. (b/18948909) Once all of a device's legacy DRM plugins support 64-bit, # that device can turn on TARGET_ENABLE_MEDIADRM_64 to build this impl as # 64-bit. -ifneq ($(TARGET_ENABLE_MEDIADRM_64), true) -LOCAL_32_BIT_ONLY := true -endif include $(BUILD_SHARED_LIBRARY) -- Gitee From cb9e692f5cc26d563a9c9f69aee1107b132c8531 Mon Sep 17 00:00:00 2001 From: yuanruibin Date: Wed, 15 Jan 2025 10:55:46 +0800 Subject: [PATCH 4/7] add attributes xml --- aosp/vendor/common/android/etc/attributes.xml | 42 +++++++++++++++++++ aosp/vendor/common/products/product_common.mk | 3 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 aosp/vendor/common/android/etc/attributes.xml diff --git a/aosp/vendor/common/android/etc/attributes.xml b/aosp/vendor/common/android/etc/attributes.xml new file mode 100644 index 000000000..16ecc7f39 --- /dev/null +++ b/aosp/vendor/common/android/etc/attributes.xml @@ -0,0 +1,42 @@ + + + + com.hermes.p6game + com.tencent.letsgo + + + com.roblox.client + com.miHoYo.Nap + com.HoYoverse.Nap + + + com.netease.dhxy + + + com.youku.phone + + + com.netease.sky + com.t2ksports.myteam + com.tgc.sky.android + com.miHoYo.Nap + com.activision.callofduty.warzone + com.roblox.client + com.HoYoverse.Nap + com.seasun.jx3 + com.studiowildcard.wardrumstudios.ark + com.kakaogames.ares + jp.pokemon.pokemontcgp + com.gameloft.android.ANMP.GloftA9HM + com.hybeim.astra + + + com.HoYoverse.hkrpgoversea + com.kurogame.wutheringwaves.global + com.miHoYo.GenshinImpact + com.kurogame.mingchao + com.miHoYo.Yuanshen + com.netease.dhxy + com.miHoYo.hkrpg + + diff --git a/aosp/vendor/common/products/product_common.mk b/aosp/vendor/common/products/product_common.mk index 770c4700b..5ec88dbbf 100644 --- a/aosp/vendor/common/products/product_common.mk +++ b/aosp/vendor/common/products/product_common.mk @@ -119,7 +119,8 @@ PRODUCT_COPY_FILES += \ vendor/common/android/media/audio_policy_engine_stream_volumes.xml:system/vendor/etc/audio_policy_engine_stream_volumes.xml \ vendor/common/android/media/audio_policy_configuration.xml:system/vendor/etc/audio_policy_configuration.xml \ vendor/common/android/media/primary_audio_policy_configuration.xml:system/vendor/etc/primary_audio_policy_configuration.xml \ - vendor/common/android/media/r_submix_audio_policy_configuration.xml:system/vendor/etc/r_submix_audio_policy_configuration.xml + vendor/common/android/media/r_submix_audio_policy_configuration.xml:system/vendor/etc/r_submix_audio_policy_configuration.xml \ + vendor/common/android/etc/attributes.xml:system/etc/attributes.xml DEVICE_PACKAGE_OVERLAYS += \ vendor/common/android/overlay -- Gitee From 7cb2511a87a09a6222a93d51b09aea9743e49e89 Mon Sep 17 00:00:00 2001 From: pengxiaochuan Date: Sun, 26 Jan 2025 03:30:32 +0000 Subject: [PATCH 5/7] fix adb connection when using proxy Signed-off-by: pengxiaochuan --- aosp/vendor/common/android/proxy/proxy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aosp/vendor/common/android/proxy/proxy b/aosp/vendor/common/android/proxy/proxy index ff93d00d8..5ae6b5532 100644 --- a/aosp/vendor/common/android/proxy/proxy +++ b/aosp/vendor/common/android/proxy/proxy @@ -210,8 +210,8 @@ rules_open() { # 创建GOST链 iptables -t mangle -N GOST > /dev/null 2>&1 - # CAE端口不走代理 - iptables -t mangle -A GOST -p tcp ! -d "${PROXY_ADDR}" --match multiport --dports 7000,7001 -j RETURN > /dev/null 2>&1 + # ADB和CAE端口不走代理 + iptables -t mangle -A GOST -p tcp ! -d "${PROXY_ADDR}" --match multiport --dports 5555,7000,7001 -j RETURN > /dev/null 2>&1 if [ "${PROXY_ENABLE_UDP}" = "true" ] ; then iptables -t mangle -A GOST -p udp ! -d "${PROXY_ADDR}" --match multiport --dports 7000,7002 -j RETURN > /dev/null 2>&1 @@ -249,7 +249,7 @@ rules_open() { iptables -t mangle -N GOST_LOCAL > /dev/null 2>&1 - iptables -t mangle -A GOST_LOCAL -p tcp ! -d "${PROXY_ADDR}" --match multiport --sports 7000,7001 -j RETURN > /dev/null 2>&1 + iptables -t mangle -A GOST_LOCAL -p tcp ! -d "${PROXY_ADDR}" --match multiport --sports 5555,7000,7001 -j RETURN > /dev/null 2>&1 if [ "${PROXY_ENABLE_UDP}" = "true" ] ; then iptables -t mangle -A GOST_LOCAL -p udp ! -d "${PROXY_ADDR}" --match multiport --sports 7000,7002 -j RETURN > /dev/null 2>&1 fi -- Gitee From 60d6de7547c6a31dfbd441ad5047a68c376b9140 Mon Sep 17 00:00:00 2001 From: xuzhenghao <12026812+xstar98@user.noreply.gitee.com> Date: Tue, 11 Feb 2025 06:33:32 +0000 Subject: [PATCH 6/7] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E9=A2=84=E7=BD=AEvulkan=E7=99=BD=E5=90=8D=E5=8D=95=20?= =?UTF-8?q?update=20README.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuzhenghao <12026812+xstar98@user.noreply.gitee.com> --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index f06f4640c..c4d3ebf5d 100644 --- a/README.md +++ b/README.md @@ -287,3 +287,19 @@ PRODUCT_PACKAGES += \ https://support.huaweicloud.com/api-cph/cph_api_0559.html 注意:同一个账号在同一个region下最多支持创建200个镜像文件 + + +##### 12. 自定义镜像预置vulkan白名单 + +构建自定义镜像支持以xml文件的形式,预置vulkan白名单,预置后,白名单中的应用可以使用vulkan + +配置方式: +aosp/vendor/common/android/etc/attributes.xml文件enable-vulkan新增包名 + + + + com.next.netcraft //这里添加包名 + com.netease.sky + + +注意:使用CMD命令添加的vulkan白名单在/data/etc/attributes.xml文件,自定义镜像预置vulkan白名单在/system/etc/attributes.xml文件,vulkan白名单实际为两个白名单文件的并集; -- Gitee From bc123514971ec6fe533fb16a75c49a739580f069 Mon Sep 17 00:00:00 2001 From: xuzhenghao <12026812+xstar98@user.noreply.gitee.com> Date: Tue, 11 Feb 2025 06:41:07 +0000 Subject: [PATCH 7/7] update README.md. Signed-off-by: xuzhenghao <12026812+xstar98@user.noreply.gitee.com> --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c4d3ebf5d..e90e610b1 100644 --- a/README.md +++ b/README.md @@ -295,6 +295,7 @@ https://support.huaweicloud.com/api-cph/cph_api_0559.html 配置方式: aosp/vendor/common/android/etc/attributes.xml文件enable-vulkan新增包名 +~~~ @@ -302,4 +303,5 @@ aosp/vendor/common/android/etc/attributes.xml文件enable-vulkan新增包名 com.netease.sky +~~~ 注意:使用CMD命令添加的vulkan白名单在/data/etc/attributes.xml文件,自定义镜像预置vulkan白名单在/system/etc/attributes.xml文件,vulkan白名单实际为两个白名单文件的并集; -- Gitee