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

Commit e2b8d8fd authored by Pranav Madapurmath's avatar Pranav Madapurmath
Browse files

Allow work profiles to set default dialer

Currently, get/set functionality for default dialer only acts on the
foreground user (primary profile). We should be passing the calling user
instead.

Bug: 256616180
Test: Manual
Change-Id: Ibb763114560a4e8ccfd67919841ae2c732f36b48
parent b2bfc9e2
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -817,10 +817,11 @@ public class TelecomServiceImpl {
        public String getDefaultDialerPackage(String callingPackage) {
            try {
                Log.startSession("TSI.gDDP", Log.getPackageAbbreviation(callingPackage));
                int callerUserId = UserHandle.getCallingUserId();
                final long token = Binder.clearCallingIdentity();
                try {
                    return mDefaultDialerCache.getDefaultDialerApplication(
                            ActivityManager.getCurrentUser());
                            callerUserId);
                } finally {
                    Binder.restoreCallingIdentity(token);
                }
@@ -1668,10 +1669,11 @@ public class TelecomServiceImpl {
                enforcePermission(MODIFY_PHONE_STATE);
                enforcePermission(WRITE_SECURE_SETTINGS);
                synchronized (mLock) {
                    int callerUserId = UserHandle.getCallingUserId();
                    long token = Binder.clearCallingIdentity();
                    try {
                        return mDefaultDialerCache.setDefaultDialer(packageName,
                                ActivityManager.getCurrentUser());
                                callerUserId);
                    } finally {
                        Binder.restoreCallingIdentity(token);
                    }