Settings: Safeguard ringtone pref against faulty gapps
* Gapps which replaces AOSP sound picker and do not overlay config, crashes this preference. Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
This commit is contained in:
@@ -74,8 +74,12 @@ public class RingtonePreference extends Preference {
|
||||
true);
|
||||
mShowSilent = a.getBoolean(com.android.internal.R.styleable.RingtonePreference_showSilent,
|
||||
true);
|
||||
setIntent(new Intent(RingtoneManager.ACTION_RINGTONE_PICKER)
|
||||
.setPackage(context.getString(R.string.config_sound_picker_package_name)));
|
||||
String packageName = context.getString(R.string.config_sound_picker_package_name);
|
||||
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
|
||||
if (com.android.internal.util.evolution.Utils.isPackageInstalled(context, packageName)) {
|
||||
intent.setPackage(packageName);
|
||||
}
|
||||
setIntent(intent);
|
||||
setUserId(UserHandle.myUserId());
|
||||
a.recycle();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user