Merge "Update the GrantTrustResult to remove static factory method." into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
bb497479ab
@@ -11816,10 +11816,10 @@ package android.service.translation {
|
||||
package android.service.trust {
|
||||
|
||||
public final class GrantTrustResult implements android.os.Parcelable {
|
||||
ctor public GrantTrustResult(int);
|
||||
method public int describeContents();
|
||||
method public int getStatus();
|
||||
method @NonNull public static String statusToString(int);
|
||||
method @NonNull public static android.service.trust.GrantTrustResult withStatus(int);
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.service.trust.GrantTrustResult> CREATOR;
|
||||
field public static final int STATUS_UNKNOWN = 0; // 0x0
|
||||
|
||||
@@ -32,7 +32,7 @@ import java.lang.annotation.RetentionPolicy;
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@DataClass(genHiddenConstructor = true)
|
||||
@DataClass
|
||||
@SystemApi
|
||||
public final class GrantTrustResult implements Parcelable {
|
||||
|
||||
@@ -42,15 +42,10 @@ public final class GrantTrustResult implements Parcelable {
|
||||
/** The device went from locked to unlocked as a result of the call. */
|
||||
public static final int STATUS_UNLOCKED_BY_GRANT = 1;
|
||||
|
||||
/** The status code of the result. */
|
||||
@Status
|
||||
private int mStatus;
|
||||
|
||||
/** Returns a new {@link GrantTrustResult} with the specified status. */
|
||||
@NonNull
|
||||
public static GrantTrustResult withStatus(@Status int status) {
|
||||
return new GrantTrustResult(status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Code below generated by codegen v1.0.23.
|
||||
@@ -90,7 +85,8 @@ public final class GrantTrustResult implements Parcelable {
|
||||
/**
|
||||
* Creates a new GrantTrustResult.
|
||||
*
|
||||
* @hide
|
||||
* @param status
|
||||
* The status code of the result.
|
||||
*/
|
||||
@DataClass.Generated.Member
|
||||
public GrantTrustResult(
|
||||
@@ -109,6 +105,9 @@ public final class GrantTrustResult implements Parcelable {
|
||||
// onConstructed(); // You can define this method to get a callback
|
||||
}
|
||||
|
||||
/**
|
||||
* The status code of the result.
|
||||
*/
|
||||
@DataClass.Generated.Member
|
||||
public @Status int getStatus() {
|
||||
return mStatus;
|
||||
@@ -165,10 +164,10 @@ public final class GrantTrustResult implements Parcelable {
|
||||
};
|
||||
|
||||
@DataClass.Generated(
|
||||
time = 1647878197834L,
|
||||
time = 1648138312806L,
|
||||
codegenVersion = "1.0.23",
|
||||
sourceFile = "frameworks/base/core/java/android/service/trust/GrantTrustResult.java",
|
||||
inputSignatures = "public static final int STATUS_UNKNOWN\npublic static final int STATUS_UNLOCKED_BY_GRANT\nprivate @android.service.trust.GrantTrustResult.Status int mStatus\npublic static @android.annotation.NonNull android.service.trust.GrantTrustResult withStatus(int)\nclass GrantTrustResult extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genHiddenConstructor=true)")
|
||||
inputSignatures = "public static final int STATUS_UNKNOWN\npublic static final int STATUS_UNLOCKED_BY_GRANT\nprivate @android.service.trust.GrantTrustResult.Status int mStatus\nclass GrantTrustResult extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass")
|
||||
@Deprecated
|
||||
private void __metadata() {}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.server.trust;
|
||||
|
||||
import static android.service.trust.GrantTrustResult.STATUS_UNLOCKED_BY_GRANT;
|
||||
import static android.service.trust.TrustAgentService.FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE;
|
||||
|
||||
import android.Manifest;
|
||||
@@ -642,9 +643,7 @@ public class TrustManagerService extends SystemService {
|
||||
if (shouldSendCallback) {
|
||||
if (resultCallback != null) {
|
||||
if (DEBUG) Slog.d(TAG, "calling back with UNLOCKED_BY_GRANT");
|
||||
resultCallback.complete(
|
||||
GrantTrustResult.withStatus(
|
||||
GrantTrustResult.STATUS_UNLOCKED_BY_GRANT));
|
||||
resultCallback.complete(new GrantTrustResult(STATUS_UNLOCKED_BY_GRANT));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user