summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Greg Kaiser <gkaiser@google.com> 2021-02-18 14:44:25 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-02-18 14:44:25 +0000
commite8b3bbe11c3d146feb1895bc17c1ff03c3acd70c (patch)
tree1e3e97ccf475cec5d8b24bfae4938094698664ab
parentf0123b8a3c78c248779a64327e58e43e5250cc3c (diff)
parent1caea4a95a857e020f37c235c15905317c70dfbc (diff)
Merge "Revert "Throw IllegalArgumentException when calling""
-rw-r--r--core/java/com/android/internal/widget/LockPatternUtils.java4
-rw-r--r--core/tests/coretests/src/com/android/internal/widget/LockPatternUtilsTest.java12
2 files changed, 0 insertions, 16 deletions
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index a7951b8d5a01..a161f18b2aab 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -1103,10 +1103,6 @@ public class LockPatternUtils {
* {@link #CREDENTIAL_TYPE_PASSWORD}
*/
public @CredentialType int getCredentialTypeForUser(int userHandle) {
- if (userHandle < 0) {
- throw new IllegalArgumentException("Invalid userHandle: " + userHandle);
- }
-
try {
return getLockSettings().getCredentialType(userHandle);
} catch (RemoteException re) {
diff --git a/core/tests/coretests/src/com/android/internal/widget/LockPatternUtilsTest.java b/core/tests/coretests/src/com/android/internal/widget/LockPatternUtilsTest.java
index d3ce0d88c56d..6167c4b80cee 100644
--- a/core/tests/coretests/src/com/android/internal/widget/LockPatternUtilsTest.java
+++ b/core/tests/coretests/src/com/android/internal/widget/LockPatternUtilsTest.java
@@ -18,13 +18,10 @@ package com.android.internal.widget;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
-import static org.testng.Assert.assertThrows;
-import android.content.Context;
import android.os.UserHandle;
import androidx.test.filters.SmallTest;
-import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
@@ -34,9 +31,6 @@ import org.junit.runner.RunWith;
@SmallTest
public class LockPatternUtilsTest {
- private static final int INVALID_USER_ID = -1;
- private final Context mContext = InstrumentationRegistry.getInstrumentation().getContext();
-
@Test
public void testUserFrp_isNotRegularUser() throws Exception {
assertTrue(LockPatternUtils.USER_FRP < 0);
@@ -49,10 +43,4 @@ public class LockPatternUtilsTest {
assertNotEquals(UserHandle.USER_CURRENT, LockPatternUtils.USER_FRP);
assertNotEquals(UserHandle.USER_CURRENT_OR_SELF, LockPatternUtils.USER_FRP);
}
-
- @Test
- public void getCredentialTypeForUser_invalidUserId_throwsIllegalArgumentException() {
- assertThrows(IllegalArgumentException.class,
- () -> new LockPatternUtils(mContext).getCredentialTypeForUser(INVALID_USER_ID));
- }
}