Hide emergency app settings on non-voice deivces
Bug: 19841649 Change-Id: I30ba582f503514656c99f3aea2801a68dfd1a5fa
This commit is contained in:
@@ -46,7 +46,10 @@ public class DefaultEmergencyPreference extends ListPreference {
|
||||
public DefaultEmergencyPreference(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
mContentResolver = context.getContentResolver();
|
||||
load();
|
||||
|
||||
if (isAvailable(context)) {
|
||||
load();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -149,6 +152,11 @@ public class DefaultEmergencyPreference extends ListPreference {
|
||||
return packages;
|
||||
}
|
||||
|
||||
public static boolean isAvailable(Context context) {
|
||||
return context.getResources().getBoolean(
|
||||
com.android.internal.R.bool.config_voice_capable);
|
||||
}
|
||||
|
||||
private static boolean isSystemApp(PackageInfo info) {
|
||||
return info.applicationInfo != null
|
||||
&& (info.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0;
|
||||
|
Reference in New Issue
Block a user