Logging SetNewPasswordActivity events

Every launch of the activity with either ACTION_SET_NEW_PASSWORD
or ACTION_SET_NEW_PARENT_PROFILE_PASSWORD is logged, regardless
of whether extra EXTRA_PASSWORD_COMPLEXITY is used or whether
the caller has the required permisssion or not
- action: ACTION_SET_NEW_PASSWORD or
ACTION_SET_NEW_PARENT_PROFILE_PASSWORD
- pageId: SET_NEW_PASSWORD_ACTIVITY
- key: calling app package name
- value: raw value of intent extra EXTRA_PASSWORD_COMPLEXITY, or
Integer.MIN_VALUE if it does not exist

Bug: 120840632
Test: atest packages/apps/Settings/tests/robotests/src/com/android/settings/password/PasswordUtilsTest.java
      atest packages/apps/Settings/tests/robotests/src/com/android/settings/password/SetNewPasswordActivityTest.java
Change-Id: I57dc55110f7f284ddad7d3fc971d1f2298b46cbd
This commit is contained in:
Bernard Chau
2019-01-29 18:28:13 +00:00
parent 09c932b2b9
commit 00870bff0d
5 changed files with 176 additions and 9 deletions

View File

@@ -32,11 +32,13 @@ import java.util.Set;
public class ShadowPasswordUtils {
private static String sCallingAppLabel;
private static String sCallingAppPackageName;
private static Set<String> sGrantedPermissions;
public static void reset() {
sCallingAppLabel = null;
sGrantedPermissions = null;
sCallingAppPackageName = null;
}
@Implementation
@@ -63,4 +65,13 @@ public class ShadowPasswordUtils {
public static void setCallingAppLabel(String label) {
sCallingAppLabel = label;
}
@Implementation
protected static String getCallingAppPackageName(IBinder activityToken) {
return sCallingAppPackageName;
}
public static void setCallingAppPackageName(String packageName) {
sCallingAppPackageName = packageName;
}
}