signed

QiShunwang

“诚信为本、客户至上”

展讯8.0在情景模式中添加一个开关机铃声开关

2021/6/3 17:45:35   来源:

vendor/sprd/platform/packages/apps/AudioProfile/res/xml/audio_profile_sound_settings.xml

vendor/sprd/platform/packages/apps/AudioProfile/res/xml/audio_profile_sound_settings.xml
@@ -69,6 +69,10 @@
             android:defaultValue="true" /> -->
 
+     <com.sprd.audioprofile.AudioProfileCheckBoxPrefrence
+        android:key="On_off_bell"
+        android:title="@string/switch_ring_switch"
+        android:defaultValue="false" />
    <com.sprd.audioprofile.AudioProfileCheckBoxPrefrence
             android:key="sound_effects"
             android:title="@string/sound_effects_enable_title"
             android:defaultValue="true" />

vendor/sprd/platform/packages/apps/AudioProfile/res/values-zh-rCN/strings.xml

 a/vendor/sprd/platform/packages/apps/AudioProfile/res/values-zh-rCN/strings.xml
+++ b/vendor/sprd/platform/packages/apps/AudioProfile/res/values-zh-rCN/strings.xml
@@ -39,6 +39,7 @@
   <string name="ring_volume_summary"></string>
   <string name="dial_pad_tones_title">"拨号键盘提示音"</string>
   <string name="screen_locking_sounds_title">"屏幕锁定提示音"</string>
+  <string name="switch_ring_switch">"开关机铃声开关"</string>
   <string name="sound_effects_enable_title">"触摸提示音"</string>
   <!-- <string name="charging_sounds_title">"充电提示音"</string> -->
   <string name="haptic_feedback_enable_title">"触摸时振动"</string>

vendor/sprd/platform/packages/apps/AudioProfile/res/values/strings.xml

/vendor/sprd/platform/packages/apps/AudioProfile/res/values/strings.xml
@@ -50,6 +50,7 @@
        <string name="ring_volume_summary">""</string>
     <string name="dial_pad_tones_title">Dial pad tones</string>
     <string name="screen_locking_sounds_title">Screen locking sounds</string>
+       <string name="switch_ring_switch">"On off ring switch"</string>
     <!-- <string name="charging_sounds_title">Charging sounds</string> -->
        <string name="sound_effects_enable_title">Touch sounds</string>
     <string name="haptic_feedback_enable_title">Vibrate on touch</string>

vendor/sprd/platform/packages/apps/AudioProfile/src/com/sprd/audioprofile/AudioProfileSoundSettings.java

vendor/sprd/platform/packages/apps/AudioProfile/src/com/sprd/audioprofile/AudioProfileSoundSettings.java
@@ -55,6 +55,7 @@ import android.content.ContentUris;
 import android.content.ContentValues;
 import android.content.res.Configuration;
 import android.media.SoundPool;
+import android.os.SystemProperties;
 
 import com.android.internal.telephony.TelephonyIntents;
 import com.android.internal.telephony.IccCardConstants;
@@ -77,7 +78,7 @@ public class AudioProfileSoundSettings extends PreferenceActivity {
     private static final String KEY_SOUND_EFFECTS = "sound_effects";
     private static final String KEY_HAPTIC_FEEDBACK = "haptic_feedback";
     private static final String KEY_LOCK_SOUNDS = "lock_sounds";
-
+       private static final String KEY_ON_OFF_BELL = "On_off_bell";
     public static final String KEY_SIM_RINGTONE = "ringtone";
     public static final String KEY_SIM_RINGTONE_CATEGORY = "category_calls_and_notification";
 
@@ -121,6 +122,7 @@ public class AudioProfileSoundSettings extends PreferenceActivity {
     private CheckBoxPreference mSoundEffects;
     private CheckBoxPreference mHapticFeedback;
     private CheckBoxPreference mLockSounds;
+       private CheckBoxPreference mONOFFBELL;
     private AudioProfileRingerVolumePreference mVolume;
 
     private AudioManager mAudioManager;
@@ -294,6 +296,13 @@ public class AudioProfileSoundSettings extends PreferenceActivity {
             mLockSounds.setPersistent(false);
             mLockSounds.setChecked(mAudioProfile.mLockSounds == AudioProfile.IS_LOCK_SOUNDS);
         }
+               mONOFFBELL = (CheckBoxPreference) findPreference(KEY_ON_OFF_BELL);
+               String ringString =  SystemProperties.get("persist.sys.bootanim.play_sound", "0");
+               boolean isRingChecked = ringString.equals("0");
+        if (mONOFFBELL != null) {
+            mONOFFBELL.setPersistent(false);
+            mONOFFBELL.setChecked(isRingChecked);
+        }
         

device\sprd\pike2\sp7731e_1h10\system.prop

+ persist.sys.bootanim.play_sound=0