diff --git a/README.md b/README.md index c211977086228923e4c6b37c7b30174581a3b2f5..f06f4640c12f682a469bf64906324ea1afc6081b 100644 --- a/README.md +++ b/README.md @@ -285,3 +285,5 @@ PRODUCT_PACKAGES += \ 支持镜像查询以及同region不同账号镜像共享 https://support.huaweicloud.com/api-cph/cph_api_0559.html + +注意:同一个账号在同一个region下最多支持创建200个镜像文件 diff --git a/aosp/frameworks/base/cmds/screencap/Android.bp b/aosp/frameworks/base/cmds/screencap/Android.bp index 248c67589696259f9355ac3251a235914561b318..635ca1867281a1789b25ff8f375aac28fb211e18 100644 --- a/aosp/frameworks/base/cmds/screencap/Android.bp +++ b/aosp/frameworks/base/cmds/screencap/Android.bp @@ -12,6 +12,10 @@ cc_binary { "libgui", ], + static_libs: [ + "libscreencap_vendor", + ], + cflags: [ "-Wall", "-Werror", diff --git a/aosp/frameworks/base/cmds/screencap/screencap.cpp b/aosp/frameworks/base/cmds/screencap/screencap.cpp index bb32dd2fa7ad8e170a23d463c6d59f59e1b2de6a..48a4a69cfee6237b63f564953c4f8da9755f2ad6 100644 --- a/aosp/frameworks/base/cmds/screencap/screencap.cpp +++ b/aosp/frameworks/base/cmds/screencap/screencap.cpp @@ -36,6 +36,7 @@ #include #include +#include "HwScreencap.h" // TODO: Fix Skia. #pragma GCC diagnostic push @@ -100,8 +101,9 @@ static uint32_t dataSpaceToInt(ui::Dataspace d) } static status_t notifyMediaScanner(const char* fileName) { + std::string inputFilePath = getCmdPath(fileName); std::string filePath("file://"); - filePath.append(fileName); + filePath.append(inputFilePath); char *cmd[] = { (char*) "am", (char*) "broadcast", diff --git a/aosp/frameworks/native/services/surfaceflinger/DisplayDevice.cpp b/aosp/frameworks/native/services/surfaceflinger/DisplayDevice.cpp index 9ff603a5ceb1c8973a42bdeb61d8d02a6495c13e..d0e226185ebb83aab27055521f087883e7843dc7 100644 --- a/aosp/frameworks/native/services/surfaceflinger/DisplayDevice.cpp +++ b/aosp/frameworks/native/services/surfaceflinger/DisplayDevice.cpp @@ -236,8 +236,7 @@ void DisplayDevice::setProjection(ui::Rotation orientation, Rect viewport, Rect if (sPrimaryDisplayRotationFlags != ui::Transform::toRotationFlags(orientation)) { // 通知hwConposer屏幕发生旋转 const auto displayId = getId(); - int32_t transformFlag = ui::Transform::toRotationFlags(orientation) > 0 ? 1 : 0; - mFlinger->getHwComposer().eventControl(*displayId, HWC_EVENT_ORIENTATION_CHANGED, transformFlag); + mFlinger->getHwComposer().eventControl(*displayId, HWC_EVENT_ORIENTATION_CHANGED, ui::toRotationInt(orientation)); } sPrimaryDisplayRotationFlags = ui::Transform::toRotationFlags(orientation); transformOrientation = ui::Transform::toRotationFlags(orientation + mPhysicalOrientation); diff --git a/aosp/packages/providers/MediaProvider/Android.bp b/aosp/packages/providers/MediaProvider/Android.bp index e1ac31ded6c05ecb9bdd7f4fa3f60308584b22a6..c78b5189c1a654c1969aec0c0bf5a20af7945bf9 100644 --- a/aosp/packages/providers/MediaProvider/Android.bp +++ b/aosp/packages/providers/MediaProvider/Android.bp @@ -7,6 +7,7 @@ android_app { "androidx.appcompat_appcompat", "androidx.core_core", "guava", + "MediaProvider-vendor", ], libs: [ diff --git a/aosp/packages/providers/MediaProvider/src/com/android/providers/media/MediaService.java b/aosp/packages/providers/MediaProvider/src/com/android/providers/media/MediaService.java index d7c6babdf6eac93e9079e3de3ce4a407d2353300..2ef3b7983d6f996f0c928d2d96434d4941cc93d8 100644 --- a/aosp/packages/providers/MediaProvider/src/com/android/providers/media/MediaService.java +++ b/aosp/packages/providers/MediaProvider/src/com/android/providers/media/MediaService.java @@ -160,6 +160,10 @@ public class MediaService extends JobIntentService { private static Uri onScanFile(Context context, Uri uri) throws IOException { final File file = new File(uri.getPath()).getCanonicalFile(); + HwMediaService hwMediaService = new HwMediaService(); + if (!hwMediaService.checkFile(file)) { + throw new IOException("Invalid path " + file.getPath()); + } try (ContentProviderClient cpc = context.getContentResolver() .acquireContentProviderClient(MediaStore.AUTHORITY)) { final MediaProvider provider = ((MediaProvider) cpc.getLocalContentProvider()); diff --git a/aosp/vendor/common/android/cph/frameworks/base/native/cmds/Android.bp b/aosp/vendor/common/android/cph/frameworks/base/native/cmds/Android.bp index ddce2ef2a6a20f99e3ddd756b7dea0621d5db999..9cc349d2b0e5c5aab33fc1fcf989669b79c145a4 100644 --- a/aosp/vendor/common/android/cph/frameworks/base/native/cmds/Android.bp +++ b/aosp/vendor/common/android/cph/frameworks/base/native/cmds/Android.bp @@ -32,4 +32,21 @@ cc_prebuilt_library_static { strip : { none: true, }, -} \ No newline at end of file +} + +cc_prebuilt_library_static { + name: "libscreencap_vendor", + compile_multilib: "both", + export_include_dirs: ["./include"], + multilib: { + lib64: { + srcs: ["lib64/libscreencap_vendor_impl.a"], + }, + lib32: { + srcs: ["lib/libscreencap_vendor_impl.a"], + }, + }, + strip : { + none: true, + }, +} diff --git a/aosp/vendor/common/android/cph/frameworks/base/native/cmds/include/HwScreencap.h b/aosp/vendor/common/android/cph/frameworks/base/native/cmds/include/HwScreencap.h new file mode 100644 index 0000000000000000000000000000000000000000..01e34eed9fcb5b51b0ea3fac0f1529c1f0212075 --- /dev/null +++ b/aosp/vendor/common/android/cph/frameworks/base/native/cmds/include/HwScreencap.h @@ -0,0 +1,5 @@ +#pragma once + +#include + +std::string getCmdPath(const char *filePath); diff --git a/aosp/vendor/common/android/cph/frameworks/base/native/cmds/lib/libscreencap_vendor_impl.a b/aosp/vendor/common/android/cph/frameworks/base/native/cmds/lib/libscreencap_vendor_impl.a new file mode 100644 index 0000000000000000000000000000000000000000..761ec87ee3dd4bda76e999ac80723588e79c764d Binary files /dev/null and b/aosp/vendor/common/android/cph/frameworks/base/native/cmds/lib/libscreencap_vendor_impl.a differ diff --git a/aosp/vendor/common/android/cph/frameworks/base/native/cmds/lib64/libscreencap_vendor_impl.a b/aosp/vendor/common/android/cph/frameworks/base/native/cmds/lib64/libscreencap_vendor_impl.a new file mode 100644 index 0000000000000000000000000000000000000000..b011b786765350b7a33e947fea08efc99fef9083 Binary files /dev/null and b/aosp/vendor/common/android/cph/frameworks/base/native/cmds/lib64/libscreencap_vendor_impl.a differ diff --git a/aosp/vendor/common/android/cph/packages/providers/MediaProvider/src/com/android/providers/media/Android.bp b/aosp/vendor/common/android/cph/packages/providers/MediaProvider/src/com/android/providers/media/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..038002e924e427eb3550c350f144535c08775508 --- /dev/null +++ b/aosp/vendor/common/android/cph/packages/providers/MediaProvider/src/com/android/providers/media/Android.bp @@ -0,0 +1,11 @@ +java_import { + name: "MediaProvider-vendor", + installable: false, + required: ["MediaProvider-vendor-impl"], + jars: ["MediaProvider-vendor-impl.jar"], + + apex_available: [ + "//apex_available:platform", + "//apex_available:anyapex", + ], +} diff --git a/aosp/vendor/common/android/cph/packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider-vendor-impl.jar b/aosp/vendor/common/android/cph/packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider-vendor-impl.jar new file mode 100644 index 0000000000000000000000000000000000000000..44b743347aea318c970f211e5ac8acaa3f2a6d51 Binary files /dev/null and b/aosp/vendor/common/android/cph/packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider-vendor-impl.jar differ diff --git a/aosp/vendor/common/android/media/audio_policy_configuration.xml b/aosp/vendor/common/android/media/audio_policy_configuration.xml new file mode 100644 index 0000000000000000000000000000000000000000..ac820e1267f1655c3642291a1e40618570de1dc8 --- /dev/null +++ b/aosp/vendor/common/android/media/audio_policy_configuration.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/aosp/vendor/common/android/media/primary_audio_policy_configuration.xml b/aosp/vendor/common/android/media/primary_audio_policy_configuration.xml new file mode 100644 index 0000000000000000000000000000000000000000..0b4c2cd4833ad989010db4c53acf921c6728dc16 --- /dev/null +++ b/aosp/vendor/common/android/media/primary_audio_policy_configuration.xml @@ -0,0 +1,31 @@ + + + + Speaker + Built-In Mic + + Speaker + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aosp/vendor/common/android/media/r_submix_audio_policy_configuration.xml b/aosp/vendor/common/android/media/r_submix_audio_policy_configuration.xml new file mode 100644 index 0000000000000000000000000000000000000000..2f5fa8d327d18a024744c59af9e8782bcbc7a826 --- /dev/null +++ b/aosp/vendor/common/android/media/r_submix_audio_policy_configuration.xml @@ -0,0 +1,32 @@ + + + + Remote Submix In + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aosp/vendor/common/products/product_common.mk b/aosp/vendor/common/products/product_common.mk index 90313a9de5628c0159653d7fd658d0076240ffc9..cad57dbb2885f8bcfaedf5d83c588ae771e75314 100644 --- a/aosp/vendor/common/products/product_common.mk +++ b/aosp/vendor/common/products/product_common.mk @@ -50,7 +50,8 @@ PRODUCT_PACKAGES += \ libGLESv2_slow_binding \ libGLESv3_slow_binding \ ni_rsrc_mon \ - ni_rsrc_list + ni_rsrc_list \ + audio.primary.defaul PRODUCT_PROPERTY_OVERRIDES += \ ro.hardware.gralloc=$(BUILD_HARDWARE) \ @@ -116,7 +117,11 @@ PRODUCT_COPY_FILES += \ vendor/common/android/media/audio_policy_engine_configuration.xml:system/vendor/etc/audio_policy_engine_configuration.xml \ vendor/common/android/media/audio_policy_engine_default_stream_volumes.xml:system/vendor/etc/audio_policy_engine_default_stream_volumes.xml \ vendor/common/android/media/audio_policy_engine_product_strategies.xml:system/vendor/etc/audio_policy_engine_product_strategies.xml \ - 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_engine_stream_volumes.xml:system/vendor/etc/audio_policy_engine_stream_volumes.xml \ + 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 DEVICE_PACKAGE_OVERLAYS += \ vendor/common/android/overlay