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

Commit 4a49cf2e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Check whether a user is restricted for SMS role."

parents 8924b61e 52711e68
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.packageinstaller.role.model;
import android.content.Context;
import android.os.Process;
import android.os.UserHandle;
import android.os.UserManager;
import android.telephony.TelephonyManager;

import androidx.annotation.NonNull;
@@ -44,10 +45,10 @@ public class SmsRoleBehavior implements RoleBehavior {
        if (UserUtils.isWorkProfile(user, context)) {
            return false;
        }
        // FIXME: STOPSHIP: Add an appropriate @SystemApi for this.
        //if (userManager.getUserInfo(user.getIdentifier()).isRestricted()) {
        //    return false;
        //}
        UserManager userManager = context.getSystemService(UserManager.class);
        if (userManager.isRestrictedProfile(user)) {
            return false;
        }
        TelephonyManager telephonyManager = context.getSystemService(TelephonyManager.class);
        if (!telephonyManager.isSmsCapable()) {
            return false;
+0 −2
Original line number Diff line number Diff line
@@ -96,6 +96,4 @@ public class UserUtils {
            }
        }
    }


}