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

Commit 3f06b560 authored by Pavel Grafov's avatar Pavel Grafov Committed by Android (Google) Code Review
Browse files

Merge "Clean up fully rolled out HeadlessSingleUserFixes" into main

parents d88a1520 7f3429df
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -256,16 +256,6 @@ flag {
    }
}

flag {
    name: "headless_single_user_fixes"
    namespace: "enterprise"
    description: "Various fixes for headless single user mode"
    bug: "289515470"
    metadata {
      purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "backup_connected_apps_settings"
    namespace: "enterprise"
+0 −4
Original line number Diff line number Diff line
@@ -18,10 +18,8 @@
package com.android.keyguard

import android.app.admin.DevicePolicyManager
import android.app.admin.flags.Flags as DevicePolicyFlags
import android.content.res.Configuration
import android.media.AudioManager
import android.platform.test.annotations.EnableFlags
import android.telephony.TelephonyManager
import android.testing.TestableLooper.RunWithLooper
import android.testing.TestableResources
@@ -942,7 +940,6 @@ class KeyguardSecurityContainerControllerTest : SysuiTestCase() {
    }

    @Test
    @EnableFlags(DevicePolicyFlags.FLAG_HEADLESS_SINGLE_USER_FIXES)
    fun showAlmostAtWipeDialog_calledOnMainUser_setsCorrectUserType() {
        val mainUserId = 10

@@ -959,7 +956,6 @@ class KeyguardSecurityContainerControllerTest : SysuiTestCase() {
    }

    @Test
    @EnableFlags(DevicePolicyFlags.FLAG_HEADLESS_SINGLE_USER_FIXES)
    fun showAlmostAtWipeDialog_calledOnNonMainUser_setsCorrectUserType() {
        val secondaryUserId = 10
        val mainUserId = 0
+0 −3
Original line number Diff line number Diff line
@@ -17,8 +17,6 @@
package com.android.systemui.authentication.domain.interactor

import android.app.admin.DevicePolicyManager
import android.app.admin.flags.Flags as DevicePolicyFlags
import android.platform.test.annotations.EnableFlags
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.widget.LockPatternUtils
@@ -414,7 +412,6 @@ class AuthenticationInteractorTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(DevicePolicyFlags.FLAG_HEADLESS_SINGLE_USER_FIXES)
    fun upcomingWipe() =
        testScope.runTest {
            val upcomingWipe by collectLastValue(underTest.upcomingWipe)
+1 −7
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import static com.android.systemui.flags.Flags.LOCKSCREEN_ENABLE_LANDSCAPE;

import android.app.ActivityManager;
import android.app.admin.DevicePolicyManager;
import android.app.admin.flags.Flags;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
@@ -1140,12 +1139,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
            int remainingBeforeWipe, int failedAttempts) {
        int userType = USER_TYPE_PRIMARY;
        if (expiringUserId == userId) {
            int primaryUser = UserHandle.USER_SYSTEM;
            if (Flags.headlessSingleUserFixes()) {
                if (mainUserId != null) {
                    primaryUser = mainUserId;
                }
            }
            int primaryUser = mainUserId != null ? mainUserId : UserHandle.USER_SYSTEM;
            // TODO: http://b/23522538
            if (expiringUserId != primaryUser) {
                userType = USER_TYPE_SECONDARY_USER;
+1 −7
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.systemui.authentication.domain.interactor

import android.app.admin.flags.Flags
import android.os.UserHandle
import com.android.internal.widget.LockPatternUtils
import com.android.internal.widget.LockPatternView
@@ -289,12 +288,7 @@ constructor(
    private suspend fun getWipeTarget(): WipeTarget {
        // Check which profile has the strictest policy for failed authentication attempts.
        val userToBeWiped = repository.getProfileWithMinFailedUnlockAttemptsForWipe()
        val primaryUser =
            if (Flags.headlessSingleUserFixes()) {
                selectedUserInteractor.getMainUserId() ?: UserHandle.USER_SYSTEM
            } else {
                UserHandle.USER_SYSTEM
            }
        val primaryUser = selectedUserInteractor.getMainUserId() ?: UserHandle.USER_SYSTEM
        return when (userToBeWiped) {
            selectedUserInteractor.getSelectedUserId() ->
                if (userToBeWiped == primaryUser) {
Loading