Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ae35177 authored by Fan Zhang's avatar Fan Zhang Committed by android-build-merger
Browse files

Hide default phone preference when there is no phone app.

am: dc1e0403

Change-Id: I2b588c9a31f405f66c1603aacbe67798ac637dee
parents 715564af dc1e0403
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -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) {