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);
|
true);
|
||||||
mShowSilent = a.getBoolean(com.android.internal.R.styleable.RingtonePreference_showSilent,
|
mShowSilent = a.getBoolean(com.android.internal.R.styleable.RingtonePreference_showSilent,
|
||||||
true);
|
true);
|
||||||
setIntent(new Intent(RingtoneManager.ACTION_RINGTONE_PICKER)
|
String packageName = context.getString(R.string.config_sound_picker_package_name);
|
||||||
.setPackage(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());
|
setUserId(UserHandle.myUserId());
|
||||||
a.recycle();
|
a.recycle();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user