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

Commit f10eec34 authored by Tyler Gunn's avatar Tyler Gunn Committed by Gerrit Code Review
Browse files

Merge "Add getDefaultDialerPackage which allows a user id to be specified."

parents 0c6fe60c 9d9cb3dd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1033,6 +1033,7 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
    private final PhoneAccountRegistrar mPhoneAccountRegistrar;
    private final CallsManager mCallsManager;
    private final AppOpsManager mAppOpsManager;
    private final Context mContext;

    private ConnectionServiceFocusManager.ConnectionServiceFocusListener mConnSvrFocusListener;

@@ -1063,6 +1064,7 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
        mPhoneAccountRegistrar = phoneAccountRegistrar;
        mCallsManager = callsManager;
        mAppOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
        mContext = context;
    }

    /** See {@link IConnectionService#addConnectionServiceAdapter}. */
+25 −0
Original line number Diff line number Diff line
@@ -706,6 +706,31 @@ public class TelecomServiceImpl {
            }
        }

        /**
         * @param userId user id to get the default dialer package for
         * @return the package name of the current user-selected default dialer. If no default
         *         has been selected, the package name of the system dialer is returned. If
         *         neither exists, then {@code null} is returned.
         * @see android.telecom.TelecomManager#getDefaultDialerPackage
         */
        @Override
        public String getDefaultDialerPackageForUser(int userId) {
            try {
                Log.startSession("TSI.gDDPU");
                mContext.enforceCallingOrSelfPermission(READ_PRIVILEGED_PHONE_STATE,
                        "READ_PRIVILEGED_PHONE_STATE permission required.");

                final long token = Binder.clearCallingIdentity();
                try {
                    return mDefaultDialerCache.getDefaultDialerApplication(userId);
                } finally {
                    Binder.restoreCallingIdentity(token);
                }
            } finally {
                Log.endSession();
            }
        }

        /**
         * @see android.telecom.TelecomManager#getSystemDialerPackage
         */