Phone ringtone settings for Android
Set a song from the file manager for the incoming call ringtone, enter the dial settings to tap the beep and vibrate, the ringtone will become the default ringtone
Set a song from the file manager for the incoming call ringtone, enter the dial settings to tap the beep and vibrate, the ringtone will become the default ringtone
The song is in the SD card
1. Go to File Manager
2. Set a song from the SD card to call ringtone
3. Enter settings "beep and notice" "Phone ringtone, check the ringtone of the song is just set the external song
4. Enter the dial settings and click Beep and vibrate
5. Return to Settings "beep and notice" ringtone, check incoming call tones
The song that calls the ringtone should still be the external song just set
Call tone changed back to default ringtone
First, share some common commands:
3. View command for activity under CMD terminal "START u0"
ADB Logcat | FINDSTR/C: "START u0"
ADB Shell Logcat | grep "START u0"
Logcat | FINDSTR/C: "Bdc-calling"
ADB logcat-s Androidruntime
ADB logcat-s Sound_trigger_hw_default
ADB Logcat | Findstr Ringer
ADB logcat-s System.err
ADB Shell Cat/data/system/audio_profile/0/settings.ini
/storage/emulated/0/liunian/
ADB pull/data/data/com.android.providers.telephony/
ADB pull/data/data/com.android.providers.settings/
ADB pull/data/data/com.android.providers.media/
ADB logcat-s Settingsinterface | Findstr Audioprofile
ADB logcat-s Audioprofileservice | Findstr Updaterintone
At the time of commissioning the device. Want to read and write to a file
Then use ADB remount
If prompted, use "adb disable-verity"
Then use the ADB disable-verity command
These commands will help us quickly analyze the problem
Then say:
This problem is related to SIM card, must be inserted SIM card, because need to get Soltid
SubID is equivalent to _id, which is similar to the ID guaranteed uniqueness of
SlotID is related to the card slot, SIM card in the card slot 1 slotid==0
SIM card in card slot 2 slotid==1
When the SIM card is not plugged into the phone, slotid==-1
In the Mtk67xx/packages/apps/settings/src/com/mediatek/audioprofile/defaultringtonepreference.java
if (featureoption. Mtk_multisim_ringtone_support && simnum = = Single_simcard) {
int subId = subscriptionmanager. From(getcontext()). Getactivesubscriptionidlist() [0];
Setsimid(subId);
Setsimid (1);
}
if (isnoneedsimselector() | | | simnum <= single_simcard) {
Super. OnClick();
}
}
Modified to:
if (featureoption. Mtk_multisim_ringtone_support && simnum = = Single_simcard) {
int subId = subscriptionmanager. From(getcontext()). Getactivesubscriptionidlist() [0];
//xxx begin
int SlotID = subscriptionmanager. Getslotid(subId);
If(slotid = = 1) {
SubId = 2;
}Else if(slotid = = 0) {
SubId = 1;
}
XXX End
Setsimid(subId);
Setsimid (1);
}
In the Mtk6735/packages/apps/settings/src/com/mediatek/audioprofile/editprofile.java
if (requestcode = = request_code) {
if (resultcode = = Activity. RESULT_OK) {
Msimid = data. Getlongextra(phoneconstants. Subscription_key,
SubscriptionManager. invalid_subscription_id);
Setringtonesimid(msimid);
}
Log. V("@M_" + TAG, "select SIM id =" + msimid);
Modified to:
if (requestcode = = request_code) {
if (resultcode = = Activity. RESULT_OK) {
Msimid = data. Getlongextra(phoneconstants. Subscription_key,
SubscriptionManager. invalid_subscription_id);
//xxx begin
int SlotID = subscriptionmanager. Getslotid((int) msimid);
If(slotid = = 1) {
Msimid = 2;
}Else if(slotid = = 0) {
Msimid = 1;
}
//xxxend
Setringtonesimid(msimid);
}
Log. V("@M_" + TAG, "select SIM id =" + msimid);
The effect of this two file modification is that the music in SD is set to call ringtone after
Enter the settings in the tone into the phone ringtone can see the selection is the music you set
But it sounded the default ringtone when the call came in.
There is one more file to modify
In Mtk6753_m_xxx/packages/services/telecomm/src/com/android/server/telecom/ringer.java
Phoneaccount Account = TM. Getphoneaccount(phoneaccounthandle);
if (account! = null) {
SubId = tem. Getsubidforphoneaccount(account);
}
} catch(Exception e) {
E. Printstacktrace();
Log. D(this, "Getsubidforphoneaccount error:" + e. ToString());
}
}
}
Audioprofilemanager audioprofilemgr = (audioprofilemanager) mcontext
. getsystemservice(Context. Audio_profile_service);
Uri ringtoneuri = audioprofilemgr. Getringtoneuri(audioprofilemgr. GetactiveprofileKey() , Audioprofilemanager. Type_ringtone, subId);
Modified into
}
XXX begin
int SlotID = subscriptionmanager. Getslotid(subId);
if(slotid = = 1) {
SubId = 2;
}Else if(slotid = = 0) {
SubId = 1;
}
XXX End
Audioprofilemanager audioprofilemgr = (audioprofilemanager) mcontext . Getsystemservice(Context. Audio_profile_service);
Uri ringtoneuri = audioprofilemgr. Getringtoneuri(audioprofilemgr. GetactiveprofileKey() , Audioprofilemanager. Type_ringtone, subId);
So the ringtone is set for the music on the SD card
Phone ringtone settings for Android