Hide default phone preference when there is no phone app.
Bug: 29859821
Change-Id: Ia6de0de04d74f4f947243f38ac2bd190ae586401
(cherry picked from commit bc6fc60683
)
This commit is contained in:
@@ -82,9 +82,13 @@ public class DefaultPhonePreference extends AppListPreference implements SelfAva
|
||||
return false;
|
||||
}
|
||||
|
||||
final UserManager um =
|
||||
(UserManager) context.getSystemService(Context.USER_SERVICE);
|
||||
return !um.hasUserRestriction(UserManager.DISALLOW_OUTGOING_CALLS);
|
||||
final UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
|
||||
final boolean hasUserRestriction =
|
||||
um.hasUserRestriction(UserManager.DISALLOW_OUTGOING_CALLS);
|
||||
final CharSequence[] entries = getEntries();
|
||||
return !hasUserRestriction
|
||||
&& entries != null
|
||||
&& entries.length > 0;
|
||||
}
|
||||
|
||||
public static boolean hasPhonePreference(String pkg, Context context) {
|
||||
|
Reference in New Issue
Block a user