Android12---Alarm 闹钟去除重复铃声(MTK平台)

问题

客户提出需求说闹钟里面有三对重复的铃声,需要我们去除。

代码位置

alps/frameworks/base/data/sounds/AllAudio.mk patch | blob | history
alps/frameworks/base/data/sounds/AudioPackage10.mk patch | blob | history
alps/frameworks/base/data/sounds/AudioPackage11.mk patch | blob | history
alps/frameworks/base/data/sounds/AudioPackage7.mk patch | blob | history
alps/frameworks/base/data/sounds/AudioPackage7alt.mk [changed mode: 0644->0755] patch | blob | history
alps/frameworks/base/data/sounds/AudioPackage8.mk patch | blob | history
alps/frameworks/base/data/sounds/AudioPackage9.mk patch | blob | history
alps/frameworks/base/data/sounds/AudioPackageGo.mk patch | blob | history

具体代码

diff --git a/alps/frameworks/base/data/sounds/AllAudio.mk b/alps/frameworks/base/data/sounds/AllAudio.mk
index c185198..b23d07f 100755 (executable)
--- a/alps/frameworks/base/data/sounds/AllAudio.mk
+++ b/alps/frameworks/base/data/sounds/AllAudio.mk
@@ -25,14 +25,11 @@ PRODUCT_COPY_FILES += \
     $(LOCAL_PATH)/alarms/ogg/Barium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Barium.ogg \
     $(LOCAL_PATH)/alarms/ogg/Carbon.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Carbon.ogg \
     $(LOCAL_PATH)/alarms/ogg/Fermium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Fermium.ogg \
-    $(LOCAL_PATH)/alarms/ogg/Hassium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Hassium.ogg \
     $(LOCAL_PATH)/alarms/ogg/Helium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Helium.ogg \
     $(LOCAL_PATH)/alarms/ogg/Krypton.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Krypton.ogg \
-    $(LOCAL_PATH)/alarms/ogg/Neon.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Neon.ogg \
     $(LOCAL_PATH)/alarms/ogg/Neptunium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Neptunium.ogg \
     $(LOCAL_PATH)/alarms/ogg/Nobelium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Nobelium.ogg \
     $(LOCAL_PATH)/alarms/ogg/Osmium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Osmium.ogg \
-    $(LOCAL_PATH)/alarms/ogg/Oxygen.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Oxygen.ogg \
     $(LOCAL_PATH)/alarms/ogg/Plutonium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Plutonium.ogg \
     $(LOCAL_PATH)/alarms/ogg/Promethium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Promethium.ogg \
     $(LOCAL_PATH)/alarms/ogg/Scandium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Scandium.ogg \
diff --git a/alps/frameworks/base/data/sounds/AudioPackage10.mk b/alps/frameworks/base/data/sounds/AudioPackage10.mk
index 8198f50..39923dc 100755 (executable)
--- a/alps/frameworks/base/data/sounds/AudioPackage10.mk
+++ b/alps/frameworks/base/data/sounds/AudioPackage10.mk
@@ -12,8 +12,6 @@ PRODUCT_COPY_FILES += \
         $(LOCAL_PATH)/alarms/ogg/Carbon.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Carbon.ogg \
         $(LOCAL_PATH)/alarms/ogg/Helium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Helium.ogg \
         $(LOCAL_PATH)/alarms/ogg/Krypton.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Krypton.ogg \
-        $(LOCAL_PATH)/alarms/ogg/Neon.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Neon.ogg \
-        $(LOCAL_PATH)/alarms/ogg/Oxygen.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Oxygen.ogg \
         $(LOCAL_PATH)/alarms/ogg/Osmium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Osmium.ogg \
        $(LOCAL_PATH)/effects/ogg/Effect_Tick_48k.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/Effect_Tick.ogg \
        $(LOCAL_PATH)/effects/ogg/KeypressStandard_48k.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/KeypressStandard.ogg \
diff --git a/alps/frameworks/base/data/sounds/AudioPackage11.mk b/alps/frameworks/base/data/sounds/AudioPackage11.mk
index 3288296..ff63251 100755 (executable)
--- a/alps/frameworks/base/data/sounds/AudioPackage11.mk
+++ b/alps/frameworks/base/data/sounds/AudioPackage11.mk
@@ -12,8 +12,6 @@ PRODUCT_COPY_FILES += \
        $(LOCAL_PATH)/alarms/ogg/Carbon.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Carbon.ogg \
        $(LOCAL_PATH)/alarms/ogg/Helium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Helium.ogg \
        $(LOCAL_PATH)/alarms/ogg/Krypton.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Krypton.ogg \
-       $(LOCAL_PATH)/alarms/ogg/Neon.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Neon.ogg \
-       $(LOCAL_PATH)/alarms/ogg/Oxygen.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Oxygen.ogg \
        $(LOCAL_PATH)/alarms/ogg/Osmium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Osmium.ogg \
        $(LOCAL_PATH)/effects/ogg/Effect_Tick_48k.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/Effect_Tick.ogg \
        $(LOCAL_PATH)/effects/ogg/KeypressStandard_48k.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/KeypressStandard.ogg \
diff --git a/alps/frameworks/base/data/sounds/AudioPackage7.mk b/alps/frameworks/base/data/sounds/AudioPackage7.mk
index 607493d..a650167 100755 (executable)
--- a/alps/frameworks/base/data/sounds/AudioPackage7.mk
+++ b/alps/frameworks/base/data/sounds/AudioPackage7.mk
@@ -9,7 +9,6 @@ LOCAL_PATH:= frameworks/base/data/sounds
 
 PRODUCT_COPY_FILES += \
        $(LOCAL_PATH)/alarms/ogg/Fermium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Fermium.ogg \
-       $(LOCAL_PATH)/alarms/ogg/Hassium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Hassium.ogg \
        $(LOCAL_PATH)/alarms/ogg/Neptunium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Neptunium.ogg \
        $(LOCAL_PATH)/alarms/ogg/Nobelium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Nobelium.ogg \
        $(LOCAL_PATH)/alarms/ogg/Plutonium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Plutonium.ogg \
diff --git a/alps/frameworks/base/data/sounds/AudioPackage7alt.mk b/alps/frameworks/base/data/sounds/AudioPackage7alt.mk
old mode 100644 (file)
new mode 100755 (executable)
index a0f4d89..7ff9386
--- a/alps/frameworks/base/data/sounds/AudioPackage7alt.mk
+++ b/alps/frameworks/base/data/sounds/AudioPackage7alt.mk
@@ -12,8 +12,6 @@ PRODUCT_COPY_FILES += \
        $(LOCAL_PATH)/alarms/ogg-jp/Carbon.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Carbon.ogg \
        $(LOCAL_PATH)/alarms/ogg-jp/Helium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Helium.ogg \
        $(LOCAL_PATH)/alarms/ogg-jp/Krypton.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Krypton.ogg \
-       $(LOCAL_PATH)/alarms/ogg-jp/Neon.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Neon.ogg \
-       $(LOCAL_PATH)/alarms/ogg-jp/Oxygen.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Oxygen.ogg \
        $(LOCAL_PATH)/effects/ogg/Effect_Tick.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/Effect_Tick.ogg \
        $(LOCAL_PATH)/effects/ogg/KeypressStandard_120.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/KeypressStandard.ogg \
        $(LOCAL_PATH)/effects/ogg/KeypressSpacebar_120.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/KeypressSpacebar.ogg \
diff --git a/alps/frameworks/base/data/sounds/AudioPackage8.mk b/alps/frameworks/base/data/sounds/AudioPackage8.mk
index cf1d840..46b3474 100755 (executable)
--- a/alps/frameworks/base/data/sounds/AudioPackage8.mk
+++ b/alps/frameworks/base/data/sounds/AudioPackage8.mk
@@ -9,7 +9,6 @@ LOCAL_PATH:= frameworks/base/data/sounds
 
 PRODUCT_COPY_FILES += \
        $(LOCAL_PATH)/alarms/ogg/Fermium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Fermium.ogg \
-       $(LOCAL_PATH)/alarms/ogg/Hassium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Hassium.ogg \
        $(LOCAL_PATH)/alarms/ogg/Neptunium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Neptunium.ogg \
        $(LOCAL_PATH)/alarms/ogg/Nobelium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Nobelium.ogg \
        $(LOCAL_PATH)/alarms/ogg/Osmium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Osmium.ogg \
diff --git a/alps/frameworks/base/data/sounds/AudioPackage9.mk b/alps/frameworks/base/data/sounds/AudioPackage9.mk
index d250c53..f82751d 100755 (executable)
--- a/alps/frameworks/base/data/sounds/AudioPackage9.mk
+++ b/alps/frameworks/base/data/sounds/AudioPackage9.mk
@@ -12,8 +12,6 @@ PRODUCT_COPY_FILES += \
         $(LOCAL_PATH)/alarms/ogg/Carbon.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Carbon.ogg \
         $(LOCAL_PATH)/alarms/ogg/Helium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Helium.ogg \
         $(LOCAL_PATH)/alarms/ogg/Krypton.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Krypton.ogg \
-        $(LOCAL_PATH)/alarms/ogg/Neon.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Neon.ogg \
-        $(LOCAL_PATH)/alarms/ogg/Oxygen.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Oxygen.ogg \
         $(LOCAL_PATH)/alarms/ogg/Osmium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Osmium.ogg \
        $(LOCAL_PATH)/effects/ogg/Effect_Tick.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/Effect_Tick.ogg \
        $(LOCAL_PATH)/effects/ogg/KeypressStandard.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/KeypressStandard.ogg \
diff --git a/alps/frameworks/base/data/sounds/AudioPackageGo.mk b/alps/frameworks/base/data/sounds/AudioPackageGo.mk
index f7f52ef..5892e0c 100755 (executable)
--- a/alps/frameworks/base/data/sounds/AudioPackageGo.mk
+++ b/alps/frameworks/base/data/sounds/AudioPackageGo.mk
@@ -39,7 +39,6 @@ PRODUCT_COPY_FILES += \
     $(LOCAL_PATH)/alarms/ogg/Argon.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Argon.ogg \
     $(LOCAL_PATH)/Alarm_Beep_03.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Alarm_Beep_03.ogg \
     $(LOCAL_PATH)/alarms/ogg/Helium.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Helium.ogg \
-    $(LOCAL_PATH)/alarms/ogg/Oxygen.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/Oxygen.ogg \
     $(LOCAL_PATH)/effects/ogg/Effect_Tick.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/Effect_Tick.ogg \
     $(LOCAL_PATH)/effects/ogg/KeypressStandard.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/KeypressStandard.ogg \
     $(LOCAL_PATH)/effects/ogg/KeypressSpacebar.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/KeypressSpacebar.ogg \

代码分析

Android手机的默认铃声在system/media/audio/下面。一共有四种,分别是notifications,alarms,ringtones,ui

但这些铃声是从哪加载来的了

在源码中,这些铃声是保存在frameworks/base/data/sounds/下面

通过相应的.mk文件将音频文件放到手机的相应目录下面

通过查看,发现是在frameworks/base/data/sounds/下面的AllAudio.mk里定义的

只要把相同的铃声去掉即可
 

你可能感兴趣的:(Android12,android,java)