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

Commit f0e13b9d authored by Ayush Sharma's avatar Ayush Sharma Committed by Android (Google) Code Review
Browse files

Merge "Show switch to managed profile dialog"

parents 60c18885 4c5a2954
Loading
Loading
Loading
Loading
+19 −7
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.TelephonyServiceManager.ServiceRegisterer;
import android.os.UserHandle;
import android.provider.Telephony.Sms.Intents;
import android.telephony.CarrierConfigManager;
import android.telephony.SmsManager;
@@ -46,6 +45,7 @@ import android.telephony.TelephonyManager;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.subscription.SubscriptionManagerService;
import com.android.internal.telephony.util.TelephonyUtils;
import com.android.internal.util.IndentingPrintWriter;
import com.android.telephony.Rlog;

@@ -164,7 +164,9 @@ public class SmsController extends ISmsImplBase {
        // Check if user is associated with the subscription
        if (!TelephonyPermissions.checkSubscriptionAssociatedWithUser(mContext, subId,
                Binder.getCallingUserHandle())) {
            // TODO(b/258629881): Display error dialog.
            if (TelephonyUtils.isUidForeground(mContext, Binder.getCallingUid())) {
                TelephonyUtils.showErrorIfSubscriptionAssociatedWithManagedProfile(mContext, subId);
            }
            sendErrorInPendingIntent(sentIntent, SmsManager.RESULT_USER_NOT_ALLOWED);
            return;
        }
@@ -261,7 +263,9 @@ public class SmsController extends ISmsImplBase {
        // Check if user is associated with the subscription
        if (!TelephonyPermissions.checkSubscriptionAssociatedWithUser(mContext, subId,
                Binder.getCallingUserHandle())) {
            // TODO(b/258629881): Display error dialog.
            if (TelephonyUtils.isUidForeground(mContext, Binder.getCallingUid())) {
                TelephonyUtils.showErrorIfSubscriptionAssociatedWithManagedProfile(mContext, subId);
            }
            sendErrorInPendingIntent(sentIntent, SmsManager.RESULT_USER_NOT_ALLOWED);
            return;
        }
@@ -344,7 +348,9 @@ public class SmsController extends ISmsImplBase {
        // Check if user is associated with the subscription
        if (!TelephonyPermissions.checkSubscriptionAssociatedWithUser(mContext, subId,
                Binder.getCallingUserHandle())) {
            // TODO(b/258629881): Display error dialog.
            if (TelephonyUtils.isUidForeground(mContext, Binder.getCallingUid())) {
                TelephonyUtils.showErrorIfSubscriptionAssociatedWithManagedProfile(mContext, subId);
            }
            sendErrorInPendingIntent(sentIntent, SmsManager.RESULT_USER_NOT_ALLOWED);
            return;
        }
@@ -382,7 +388,9 @@ public class SmsController extends ISmsImplBase {
        // Check if user is associated with the subscription
        if (!TelephonyPermissions.checkSubscriptionAssociatedWithUser(mContext, subId,
                Binder.getCallingUserHandle())) {
            // TODO(b/258629881): Display error dialog.
            if (TelephonyUtils.isUidForeground(mContext, Binder.getCallingUid())) {
                TelephonyUtils.showErrorIfSubscriptionAssociatedWithManagedProfile(mContext, subId);
            }
            sendErrorInPendingIntents(sentIntents, SmsManager.RESULT_USER_NOT_ALLOWED);
            return;
        }
@@ -418,7 +426,9 @@ public class SmsController extends ISmsImplBase {
        // Check if user is associated with the subscription
        if (!TelephonyPermissions.checkSubscriptionAssociatedWithUser(mContext, subId,
                Binder.getCallingUserHandle())) {
            // TODO(b/258629881): Display error dialog.
            if (TelephonyUtils.isUidForeground(mContext, Binder.getCallingUid())) {
                TelephonyUtils.showErrorIfSubscriptionAssociatedWithManagedProfile(mContext, subId);
            }
            sendErrorInPendingIntents(sentIntents, SmsManager.RESULT_USER_NOT_ALLOWED);
            return;
        }
@@ -924,7 +934,9 @@ public class SmsController extends ISmsImplBase {
        // Check if user is associated with the subscription
        if (!TelephonyPermissions.checkSubscriptionAssociatedWithUser(mContext, subId,
                Binder.getCallingUserHandle())) {
            // TODO(b/258629881): Display error dialog.
            if (TelephonyUtils.isUidForeground(mContext, Binder.getCallingUid())) {
                TelephonyUtils.showErrorIfSubscriptionAssociatedWithManagedProfile(mContext, subId);
            }
            sendErrorInPendingIntent(sentIntent, SmsManager.RESULT_USER_NOT_ALLOWED);
            return;
        }