The problem that the default ringtones after factory settings are restored are inconsistent with those after the machine is installed

Source: Internet
Author: User

After the factory settings are restored, the default ringtones are different from those after the machine is installed. These include incoming call ringtones, notification ringtones, and alarm ringtones.
If the default initial ringtone is not set separately, the default ringtone is the first ringtone In the DB.
In/data/COM. Android. providers. Media/databases/Internal. dB, the first record of each type in audio view (corresponding to audio_meta table) is the default ringtone.
For example, when calling a ringtone (ringtone) is/system/Media/Audio/ringtones/xxxx.ogg, The ringtonessort order is shown below, and the first record is named growl.ogg with the ID corresponding to 1.
That is, the default ringtones stored in the system settings table are:
60 | ringtone0 | content: // media/Internal/Audio/Media/1
61 | ringtone1 | content: // media/Internal/Audio/Media/1

The parameter values in the system settings are located in settings. DB in the com. Android. providers. Settings/databases folder under the/data directory:
# Cd com. Android. providers. Settings
#
# Ls
Databases
Lib
# Cd Databases
# Ls
Settings. DB
# Sqlite3 settings. DB
SQLite version 3.6.22
Enter ". Help" for instructions
Enter SQL statements terminated with ";"
SQLite>. Table
Android_metadata bookmarks proxylist System
Export th_devices proxy secure trusted_list
SQLite>. schema System
Create Table System (_ id integer primary key autoincrement, Name text unique on conflict replace, value text );
Create index systemindex1 on system (name );
SQLite> select * from system;
1 | volume_music | 11
2 | volume_ring | 5
3 | volume_system | 7
4 | volume_voice | 4
5 | volume_alarm | 6
6 | volume_notification | 5
7 | volume_rjth_sco | 7
8 | mode_ringer | 2
9 | vibrate_on | 4
10 | mode_ringer_streams_affected| 1062
11 | mute_streams_affected | 46
12 | dim_screen | 1
13 | stay_on_while_plugged_in | 0
14 | screen_off_timeout | 60000
15 | emergency_tone | 0
16 | call_auto_retry | 0
17 | dtmf_tone_type | 0
18 | hearing_aid | 0
19 | tty_mode | 0
20 | airplane_mode_on | 0
21 | airplane_mode_radios | cell, Bluetooth, WiFi
22 | wifi_sleep_policy | 2
23 | wifi_cellular_wlan | 2
24 | auto_time | 1
25 | screen_brightness | 1, 102
26 | screen_brightness_mode | 0
27 | window_animation_scale | 1.0
28 | transition_animation_scale | 1.0
29 | accelerometer_rotation | 1
30 | haptic_feedback_enabled | 1
31 | icationication_light_pulse | 1
32 | set_install_location | 0
33 | default_install_location | 0
34 | power_sounds_enabled | 1
35 | low_battery_sound |/system/Media/Audio/UI/lowbattery.ogg
36 | dock_sounds_enabled | 0
37 | pai_dock_sound |/system/Media/Audio/UI/dock.ogg
38 | pai_undock_sound |/system/Media/Audio/UI/undock.ogg
39 | car_dock_sound |/system/Media/Audio/UI/dock.ogg
40 | car_undock_sound |/system/Media/Audio/UI/undock.ogg
41 | lockscreen_sounds_enabled | 0
42 | lock_sound |/system/Media/Audio/UI/lock.ogg
43 | unlock_sound |/system/Media/Audio/UI/unlock.ogg
44 | vibrate_in_silent | 0
45 | phone_profiles_mode | General
46 | profiles_last_mode | General
47 | general_volume | 5
48 | meeting_volume | 0
49 | outdoor_volume | 7
50 | indoor_volume | 5
51 | sms_validity| 255
52 | icationications_use_ring_volume | 1
53 | volume_ring_last_audible | 5
54 | is_standby_select_card_show | 0
55 | sim_init_state | true
56 | wlantouplsyes | false
57 | timeouttip | 0
58 | isselectcellular | false
59 | next_alarm_formatted |
60 | ringtone0 | content: // media/Internal/Audio/Media/1
61 | ringtone1 | content: // media/Internal/Audio/Media/1
62 | alarm_alert | content: // media/Internal/Audio/Media/43
63 | notification_sound | content: // media/Internal/Audio/Media/49

After the machine is burned, the ringtones display order, and the order stored in the DB, that is, the order in which the data is scanned to the DB is the same as that in the C ++ program that reads the system ROM ringtones Folder/system/Media/Audio/ringtones.
-RW-r -- root Root 41094 growl.ogg
-RW-r -- root Root 34864 mildlyalarming.ogg
-RW-r -- root Root 26662 noises3.ogg
-RW-r -- root Root 31563 ethershake.ogg
-RW-r -- root Root 30615 caribbeanice.ogg
-RW-r -- root Root 39025 noises2.ogg
-RW-r -- root Root 38307 loopylounge.ogg
-RW-r -- root Root 46425 friendlyghost.ogg
-RW-r -- root Root 26144 springyjalopy.ogg
-RW-r -- root Root 31136 world.ogg
-RW-r -- root Root 21007 ring_digital_02.ogg
-RW-r -- root Root 52809 ring_synth_02.ogg
-RW-r -- root Root 206809 crazydream.ogg
-RW-r -- root Root 36287 noises1.ogg
-RW-r -- root Root 31641 romancingthetone.ogg
-RW-r -- root Root 28433 beatplucker.ogg
-RW-r -- root Root 175423 dreamtheme.ogg
-RW-r -- root Root 28691 veryalarmed.ogg
-RW-r -- root Root 28124 mideviljaunt.ogg
-RW-r -- root Root 59024 ring_classic_02.ogg
-RW-r -- root Root 49978 gameoverguitar.ogg
-RW-r -- root Root 41828 birdloop.ogg
-RW-r -- root Root 36620 terminated.ogg
-RW-r -- root Root 15563 newplayer.ogg
-RW-r -- root Root 30759 bentleydubs.ogg
-RW-r -- root Root 30925 curveball.ogg
-RW-r -- root Root 15146 insertcoin.ogg
-RW-r -- root Root 28898 sitarvssitar.ogg
-RW-r -- root Root 32640 organdub.ogg
-RW-r -- root Root 43965 ring_synth_04.ogg
-RW-r -- root Root 34627 loveflute.ogg
-RW-r -- root Root 26298 twirlaway.ogg

After the factory settings are restored, the ringtones display sequence is the opposite to that after the machine is burned. At this time, the underlying C ++ program reads the ringtones in the system ROM ringtone Folder/system/Media/Audio/ringtones/in the order of the ringtones, the storage sequence in dB is also the opposite of that after the first scan after the machine is burned.
As a result, after the factory was set up, the call became twirlaway.ogg.
# Ls-l
-RW-r -- root Root 26298 twirlaway.ogg
-RW-r -- root Root 34627 loveflute.ogg
-RW-r -- root Root 43965 ring_synth_04.ogg
-RW-r -- root Root 32640 organdub.ogg
-RW-r -- root Root 28898 sitarvssitar.ogg
-RW-r -- root Root 15146 insertcoin.ogg
-RW-r -- root Root 30925 curveball.ogg
-RW-r -- root Root 30759 bentleydubs.ogg
-RW-r -- root Root 15563 newplayer.ogg
-RW-r -- root Root 36620 terminated.ogg
-RW-r -- root Root 41828 birdloop.ogg
-RW-r -- root Root 49978 gameoverguitar.ogg
-RW-r -- root Root 59024 ring_classic_02.ogg
-RW-r -- root Root 28124 mideviljaunt.ogg
-RW-r -- root Root 28691 veryalarmed.ogg
-RW-r -- root Root 175423 dreamtheme.ogg
-RW-r -- root Root 28433 beatplucker.ogg
-RW-r -- root Root 31641 romancingthetone.ogg
-RW-r -- root Root 36287 noises1.ogg
-RW-r -- root Root 206809 crazydream.ogg
-RW-r -- root Root 52809 ring_synth_02.ogg
-RW-r -- root Root 21007 ring_digital_02.ogg
-RW-r -- root Root 31136 world.ogg
-RW-r -- root Root 26144 springyjalopy.ogg
-RW-r -- root Root 46425 friendlyghost.ogg
-RW-r -- root Root 38307 loopylounge.ogg
-RW-r -- root Root 39025 noises2.ogg
-RW-r -- root Root 30615 caribbeanice.ogg
-RW-r -- root Root 31563 ethershake.ogg
-RW-r -- root Root 26662 noises3.ogg
-RW-r -- root Root 34864 mildlyalarming.ogg
-RW-r -- root Root 41094 growl.ogg

After the factory settings are restored, the order in which files are read at the underlying layer is opposite to that after the machine is burned. This problem is related to the underlying Linux file management. If you do not change the underlying Linux File Reading policy, you can set the default ringtone in the configuration file.

The solution is as follows:
Set the default ringtone configuration parameters in the 3rdparty directory. For example, set the notification sound, sim1, sim2 incoming ringtone, and Alarm ringtone respectively. xxxx represents the chip manufacturer:
./3 rdparty/APP/product/special/Android/vendor/xxxx/product/xxxx_core.mk: ro.config.icationication_sound=onthehunt.ogg \
./3 rdparty/APP/product/special/Android/vendor/xxxx/product/xxxx_core.mk: ro.config.ringtone#organdub.ogg \
./3 rdparty/APP/product/special/Android/vendor/xxxx/product/xxxx_core.mk: ro.config.ringtone1#organdub.ogg \
./3 rdparty/APP/product/special/Android/vendor/xxxx/product/xxxx_core.mk: ro.config.alarm_alertw.alarm_classic.ogg
You need to add the default ringtone settings for the following two directories:
./Vendor/xxxx/product/xxxx_core.mk: ro.config.icationication_sound=onthehunt.ogg \
./Vendor/xxxx/product/xxxx_core.mk: ro.config.ringtone#organdub.ogg \
./Vendor/xxxx/product/xxxx_core.mk: ro.config.ringtone1#organdub.ogg \
./Vendor/xxxx/product/xxxx_core.mk: ro.config.alarm_alert?alarm_classic.ogg

./Build/target/product/CORE. mk: ro.config.icationication_sound=onthehunt.ogg \
./Build/target/product/CORE. mk: ro.config.ringtone#organdub.ogg \
./Build/target/product/CORE. mk: ro.config.ringtone1#organdub.ogg \
./Build/target/product/CORE. mk: ro.config.alarm_alertw.alarm_classic.ogg

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.