Merge "Some HSUM bug fixes" into main

This commit is contained in:
Treehugger Robot
2024-12-18 17:40:25 -08:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 3 deletions
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;
import android.os.Process;
import android.util.Log;
import androidx.test.ext.junit.runners.AndroidJUnit4;
@@ -74,8 +75,9 @@ public class TaplPrivateSpaceTest extends AbstractQuickStepTest {
}
private void createAndStartPrivateProfileUser() {
String createUserOutput = executeShellCommand("pm create-user --profileOf 0 --user-type "
+ "android.os.usertype.profile.PRIVATE " + PRIVATE_PROFILE_NAME);
int myUserId = Process.myUserHandle().getIdentifier();
String createUserOutput = executeShellCommand("pm create-user --profileOf " + myUserId
+ " --user-type android.os.usertype.profile.PRIVATE " + PRIVATE_PROFILE_NAME);
updatePrivateProfileSetupSuccessful("pm create-user", createUserOutput);
String[] tokens = createUserOutput.split("\\s+");
mProfileUserId = Integer.parseInt(tokens[tokens.length - 1]);
@@ -104,7 +104,7 @@ class InstallSessionHelperTest {
.thenReturn(listOf(expectedVerifiedSession))
// When
val actualSession =
installSessionHelper.getActiveSessionInfo(UserHandle(0), expectedAppPackage)
installSessionHelper.getActiveSessionInfo(myUserHandle(), expectedAppPackage)
// Then
assertThat(actualSession).isEqualTo(expectedVerifiedSession)
}