1. Restore the inconsistency between the default and the default ringtones after the factory settings
Http://blog.csdn.net/ameyume/article/details/7608070
2. Uri Alert = ringtonemanager. getdefaulturi (ringtonemanager. type_alarm );
3.
1. define a global image
Private URI myuri = NULL;
2. Uri pickeduri = data. getparcelableextra (ringtonemanager. extra_ringtone_picked_uri) in onactivityresult;
Myuri = pickeduri;
3. Add a section before startactivityforresult (intent, 0:
If (myuri! = NULL)
{
Intent. putextra (ringtonemanager. extra_ringtone_existing_uri, myuri );
}
4. default settings for Android
Modify the settings source code to modify the system settings. The settings data is stored in COM. Android. providers. Settings/databases/settings. DB. to modify the default value loaded after the system is started
One way is to directly modify the value of settings. DB
The other is to modify the default value of settingsprovider.
The settings application can configure various settings of the Android system. The default values of these settings are all read from the database by settingsprovider in frameworks. Where does the data come from when the system is started for the first time?
The frameworks/base/packages/settingsprovider/RES/values/defaults. xml file is used to store the default settings of the Android system.
For example:
<Integer name = "def_screen_off_timeout"> 600000 </Integer>
<Integer name = "def_screen_brightness"> 102 </Integer> sets the default brightness.
<Bool name = "def_install_non_market_apps"> false </bool>: sets whether to allow installation of non-market applications by default.
If you want to define ults. not found in XML. After adding it here, you need to modify frameworks/base/packages/settingsprovider/src/COM/Android/providers/settings/databasehelper. java, add your own storage code.
Ringtone: the SD card ringtones file, supports audio files (MP3, WAV, Ogg, and other formats ).
Notification ringtone: SD card specifications, supporting audio files (MP3, WAV, Ogg, and other formats ).
Alarm ringtone: SD card alarms, supports audio files (MP3, WAV, Ogg, and other formats ).
Appendix: Location of the built-in ringtone File
Ringtone:/system/Media/Audio/ringtones
Notification ringtones:/system/Media/Audio/notifications
Alert tone:/system/Media/Audio/alarms
Interface operation event sound:/system/Media/Audio/UI
Certificate -----------------------------------------------------------------------------------------------------------------------------------
5.
Set the system default ringtone:
[Java]
View plaincopyprint?
- Ringtonemanager. setactualdefaultringtoneuri (context, ringtonemanager. type_ringtone, Uri );
RingtoneManager.setActualDefaultRingtoneUri(context, RingtoneManager.TYPE_RINGTONE, uri);
Read system default ringtones:
[Java]
View plaincopyprint?
- Uri uri = ringtonemanager. getactualdefaultringtoneuri (this, ringtonemanager. Type