Loading core/java/android/content/pm/verify/developer/DeveloperVerificationSession.java +6 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,12 @@ public final class DeveloperVerificationSession implements Parcelable { public @interface DeveloperVerificationIncompleteReason { } /** * The developer verification is bypassed because of an unspecified reason. This field is * reserved and must not be used when reporting a developer verification bypass. * @hide */ public static final int DEVELOPER_VERIFICATION_BYPASSED_REASON_UNSPECIFIED = 0; /** * The developer verification is bypassed because the installation was initiated from the * Android Debug Bridge (ADB) service. Loading services/core/java/com/android/server/pm/SessionMetrics.java +3 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.annotation.Nullable; import android.content.pm.DataLoaderType; import android.content.pm.PackageInstaller; import android.content.pm.PackageManager; import android.content.pm.verify.developer.DeveloperVerificationSession; import android.content.pm.verify.developer.DeveloperVerificationStatus; import android.os.Handler; Loading Loading @@ -84,7 +85,8 @@ final class SessionMetrics { private long mDeveloperVerificationRetryDurationMillis; private int mDeveloperVerifierUid = INVALID_UID; private int mIsDeveloperVerificationBypassedReason = 0; private int mIsDeveloperVerificationBypassedReason = DeveloperVerificationSession.DEVELOPER_VERIFICATION_BYPASSED_REASON_UNSPECIFIED; private boolean mIsDeveloperVerificationTimeoutExtensionRequested = false; private final boolean mHasDeveloperVerificationExtensionParams; private boolean mIsDeveloperVerificationPolicyOverridden = false; Loading services/core/java/com/android/server/pm/verify/developer/DeveloperVerifierController.java +2 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.pm.verify.developer; import static android.content.pm.verify.developer.DeveloperVerificationSession.DEVELOPER_VERIFICATION_BYPASSED_REASON_UNSPECIFIED; import static android.content.pm.verify.developer.DeveloperVerificationSession.DEVELOPER_VERIFICATION_INCOMPLETE_NETWORK_UNAVAILABLE; import static android.content.pm.verify.developer.DeveloperVerificationSession.DEVELOPER_VERIFICATION_INCOMPLETE_UNKNOWN; import static android.os.Process.INVALID_UID; Loading Loading @@ -671,7 +672,7 @@ public class DeveloperVerifierController { + " doesn't exist or has finished"); } } if (bypassReason <= 0) { if (bypassReason <= DEVELOPER_VERIFICATION_BYPASSED_REASON_UNSPECIFIED) { throw new IllegalArgumentException("Verification session " + id + " reported invalid bypass_reason code " + bypassReason); } Loading services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/verify/developer/DeveloperVerifierControllerTest.java +4 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server.pm.verify.developer; import static android.content.pm.PackageInstaller.DEVELOPER_VERIFICATION_POLICY_BLOCK_FAIL_CLOSED; import static android.content.pm.PackageInstaller.DEVELOPER_VERIFICATION_POLICY_BLOCK_FAIL_OPEN; import static android.content.pm.verify.developer.DeveloperVerificationSession.DEVELOPER_VERIFICATION_BYPASSED_REASON_EMERGENCY; import static android.content.pm.verify.developer.DeveloperVerificationSession.DEVELOPER_VERIFICATION_BYPASSED_REASON_UNSPECIFIED; import static android.os.Process.INVALID_UID; import static com.google.common.truth.Truth.assertThat; Loading Loading @@ -482,9 +483,10 @@ public class DeveloperVerifierControllerTest { // Reason cannot be negative expectThrows(IllegalArgumentException.class, () -> session.reportVerificationBypassed(-1)); // Reason cannot be 0 // Reason cannot be unspecified expectThrows(IllegalArgumentException.class, () -> session.reportVerificationBypassed(0)); () -> session.reportVerificationBypassed( DEVELOPER_VERIFICATION_BYPASSED_REASON_UNSPECIFIED)); } @Test Loading Loading
core/java/android/content/pm/verify/developer/DeveloperVerificationSession.java +6 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,12 @@ public final class DeveloperVerificationSession implements Parcelable { public @interface DeveloperVerificationIncompleteReason { } /** * The developer verification is bypassed because of an unspecified reason. This field is * reserved and must not be used when reporting a developer verification bypass. * @hide */ public static final int DEVELOPER_VERIFICATION_BYPASSED_REASON_UNSPECIFIED = 0; /** * The developer verification is bypassed because the installation was initiated from the * Android Debug Bridge (ADB) service. Loading
services/core/java/com/android/server/pm/SessionMetrics.java +3 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.annotation.Nullable; import android.content.pm.DataLoaderType; import android.content.pm.PackageInstaller; import android.content.pm.PackageManager; import android.content.pm.verify.developer.DeveloperVerificationSession; import android.content.pm.verify.developer.DeveloperVerificationStatus; import android.os.Handler; Loading Loading @@ -84,7 +85,8 @@ final class SessionMetrics { private long mDeveloperVerificationRetryDurationMillis; private int mDeveloperVerifierUid = INVALID_UID; private int mIsDeveloperVerificationBypassedReason = 0; private int mIsDeveloperVerificationBypassedReason = DeveloperVerificationSession.DEVELOPER_VERIFICATION_BYPASSED_REASON_UNSPECIFIED; private boolean mIsDeveloperVerificationTimeoutExtensionRequested = false; private final boolean mHasDeveloperVerificationExtensionParams; private boolean mIsDeveloperVerificationPolicyOverridden = false; Loading
services/core/java/com/android/server/pm/verify/developer/DeveloperVerifierController.java +2 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.pm.verify.developer; import static android.content.pm.verify.developer.DeveloperVerificationSession.DEVELOPER_VERIFICATION_BYPASSED_REASON_UNSPECIFIED; import static android.content.pm.verify.developer.DeveloperVerificationSession.DEVELOPER_VERIFICATION_INCOMPLETE_NETWORK_UNAVAILABLE; import static android.content.pm.verify.developer.DeveloperVerificationSession.DEVELOPER_VERIFICATION_INCOMPLETE_UNKNOWN; import static android.os.Process.INVALID_UID; Loading Loading @@ -671,7 +672,7 @@ public class DeveloperVerifierController { + " doesn't exist or has finished"); } } if (bypassReason <= 0) { if (bypassReason <= DEVELOPER_VERIFICATION_BYPASSED_REASON_UNSPECIFIED) { throw new IllegalArgumentException("Verification session " + id + " reported invalid bypass_reason code " + bypassReason); } Loading
services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/verify/developer/DeveloperVerifierControllerTest.java +4 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server.pm.verify.developer; import static android.content.pm.PackageInstaller.DEVELOPER_VERIFICATION_POLICY_BLOCK_FAIL_CLOSED; import static android.content.pm.PackageInstaller.DEVELOPER_VERIFICATION_POLICY_BLOCK_FAIL_OPEN; import static android.content.pm.verify.developer.DeveloperVerificationSession.DEVELOPER_VERIFICATION_BYPASSED_REASON_EMERGENCY; import static android.content.pm.verify.developer.DeveloperVerificationSession.DEVELOPER_VERIFICATION_BYPASSED_REASON_UNSPECIFIED; import static android.os.Process.INVALID_UID; import static com.google.common.truth.Truth.assertThat; Loading Loading @@ -482,9 +483,10 @@ public class DeveloperVerifierControllerTest { // Reason cannot be negative expectThrows(IllegalArgumentException.class, () -> session.reportVerificationBypassed(-1)); // Reason cannot be 0 // Reason cannot be unspecified expectThrows(IllegalArgumentException.class, () -> session.reportVerificationBypassed(0)); () -> session.reportVerificationBypassed( DEVELOPER_VERIFICATION_BYPASSED_REASON_UNSPECIFIED)); } @Test Loading