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

Commit 97a06737 authored by Priyanka Advani (xWF)'s avatar Priyanka Advani (xWF)
Browse files

Revert "Clean up fully rolled out HeadlessSingleUserFixes"

Revert submission 28993807-hdop-cleaup

Reason for revert: Droidmonitor created revert due to b/363275535. Will be verifying through ABTD before submission.

Reverted changes: /q/submissionid:28993807-hdop-cleaup

Change-Id: I8e1f098abb53ee888be1842d4ad51b3b2ddfc31b
parent 9e7b0251
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -260,6 +260,16 @@ 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"
+4 −0
Original line number Diff line number Diff line
@@ -18,8 +18,10 @@
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
@@ -936,6 +938,7 @@ class KeyguardSecurityContainerControllerTest : SysuiTestCase() {
    }

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

@@ -952,6 +955,7 @@ class KeyguardSecurityContainerControllerTest : SysuiTestCase() {
    }

    @Test
    @EnableFlags(DevicePolicyFlags.FLAG_HEADLESS_SINGLE_USER_FIXES)
    fun showAlmostAtWipeDialog_calledOnNonMainUser_setsCorrectUserType() {
        val secondaryUserId = 10
        val mainUserId = 0
+3 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
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
@@ -412,6 +414,7 @@ class AuthenticationInteractorTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(DevicePolicyFlags.FLAG_HEADLESS_SINGLE_USER_FIXES)
    fun upcomingWipe() =
        testScope.runTest {
            val upcomingWipe by collectLastValue(underTest.upcomingWipe)
+7 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ 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;
@@ -1139,7 +1140,12 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
            int remainingBeforeWipe, int failedAttempts) {
        int userType = USER_TYPE_PRIMARY;
        if (expiringUserId == userId) {
            int primaryUser = mainUserId != null ? mainUserId : UserHandle.USER_SYSTEM;
            int primaryUser = UserHandle.USER_SYSTEM;
            if (Flags.headlessSingleUserFixes()) {
                if (mainUserId != null) {
                    primaryUser = mainUserId;
                }
            }
            // TODO: http://b/23522538
            if (expiringUserId != primaryUser) {
                userType = USER_TYPE_SECONDARY_USER;
+7 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

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
@@ -288,7 +289,12 @@ constructor(
    private suspend fun getWipeTarget(): WipeTarget {
        // Check which profile has the strictest policy for failed authentication attempts.
        val userToBeWiped = repository.getProfileWithMinFailedUnlockAttemptsForWipe()
        val primaryUser = selectedUserInteractor.getMainUserId() ?: UserHandle.USER_SYSTEM
        val primaryUser =
            if (Flags.headlessSingleUserFixes()) {
                selectedUserInteractor.getMainUserId() ?: UserHandle.USER_SYSTEM
            } else {
                UserHandle.USER_SYSTEM
            }
        return when (userToBeWiped) {
            selectedUserInteractor.getSelectedUserId() ->
                if (userToBeWiped == primaryUser) {
Loading