Disable multi-user check for entitlement provisioning
This commit updates the logic for launching the entitlement UI for tethering when there are multiple users. It disables the check for whether the current user can change tethering settings for secondary users due to a potential issue with calling createContextAsUser. This reverts the behavior change introduced in aosp/3289821. One expected outcome is this change will break tethering with entilement check enabled for HSUM-enabled devices. Since there is no currently HSUM-enabled projects, disable this check is safe. Test: Manual 1. Mock requires entitlement 2. adb shell cmd user set-system-user-mode-emulation headless 3. enable hotspot Test: atest TetheringTests:EntitlementManagerTest Bug: 382624069 Change-Id: Ife3b721d1374602a8fa760954b372429cda1bf71
This commit is contained in:
parent
4f1c1ea358
commit
b14cd877fb
2 changed files with 4 additions and 11 deletions
|
|
@ -154,7 +154,9 @@ public class EntitlementManager {
|
|||
|
||||
// Only launch entitlement UI for the current user if it is allowed to
|
||||
// change tethering. This usually means the system user or the admin users in HSUM.
|
||||
if (SdkLevel.isAtLeastT()) {
|
||||
// TODO (b/382624069): Figure out whether it is safe to call createContextAsUser
|
||||
// from secondary user. And re-enable the check or remove the code accordingly.
|
||||
if (false) {
|
||||
// Create a user context for the current foreground user as UserManager#isAdmin()
|
||||
// operates on the context user.
|
||||
final int currentUserId = getCurrentUser();
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
|||
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
|
||||
import static com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession;
|
||||
import static com.android.networkstack.apishim.ConstantsShim.KEY_CARRIER_SUPPORTS_TETHERING_BOOL;
|
||||
import static com.android.testutils.DevSdkIgnoreRule.IgnoreAfter;
|
||||
import static com.android.testutils.DevSdkIgnoreRule.IgnoreUpTo;
|
||||
import static com.android.testutils.DevSdkIgnoreRuleKt.SC_V2;
|
||||
|
||||
|
|
@ -592,16 +591,8 @@ public final class EntitlementManagerTest {
|
|||
.onTetherProvisioningFailed(TETHERING_WIFI, FAILED_TETHERING_REASON);
|
||||
}
|
||||
|
||||
@IgnoreUpTo(SC_V2)
|
||||
@Test
|
||||
public void testUiProvisioningMultiUser_aboveT() {
|
||||
doTestUiProvisioningMultiUser(true, 1);
|
||||
doTestUiProvisioningMultiUser(false, 0);
|
||||
}
|
||||
|
||||
@IgnoreAfter(SC_V2)
|
||||
@Test
|
||||
public void testUiProvisioningMultiUser_belowT() {
|
||||
public void testUiProvisioningMultiUser() {
|
||||
doTestUiProvisioningMultiUser(true, 1);
|
||||
doTestUiProvisioningMultiUser(false, 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue