summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chiachang Wang <chiachangwang@google.com> 2020-02-04 14:08:55 +0800
committer Chiachang Wang <chiachangwang@google.com> 2020-02-13 06:26:35 +0000
commit35ca498d8d9c108d9f36ea357adcd99e21865a88 (patch)
tree720989fa08463e1895ffb8de47fc18e700810992
parentb665970f8dcf4472bdf877eceba10689435bddf1 (diff)
Add Intdef annotation for eventId in logEvent
Follow API guide. Bug: 148379628 Test: make test-api-stubs-docs-update-current-api \ system-api-stubs-docs-update-current-api Change-Id: I410ef06b2fa82d8ef35513086733b0fc2cf0fe06
-rw-r--r--core/java/android/net/CaptivePortal.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/core/java/android/net/CaptivePortal.java b/core/java/android/net/CaptivePortal.java
index 448fe5a0511e..8afeb3033cdb 100644
--- a/core/java/android/net/CaptivePortal.java
+++ b/core/java/android/net/CaptivePortal.java
@@ -15,6 +15,7 @@
*/
package android.net;
+import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
@@ -24,6 +25,8 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.os.RemoteException;
+import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+
/**
* A class allowing apps handling the {@link ConnectivityManager#ACTION_CAPTIVE_PORTAL_SIGN_IN}
* activity to indicate to the system different outcomes of captive portal sign in. This class is
@@ -77,6 +80,17 @@ public class CaptivePortal implements Parcelable {
private final IBinder mBinder;
/** @hide */
+ @IntDef(value = {
+ MetricsEvent.ACTION_CAPTIVE_PORTAL_LOGIN_ACTIVITY,
+ MetricsEvent.ACTION_CAPTIVE_PORTAL_LOGIN_RESULT_DISMISSED,
+ MetricsEvent.ACTION_CAPTIVE_PORTAL_LOGIN_RESULT_UNWANTED,
+ MetricsEvent.ACTION_CAPTIVE_PORTAL_LOGIN_RESULT_WANTED_AS_IS,
+ MetricsEvent.CAPTIVE_PORTAL_LOGIN_ACTIVITY_SSL_ERROR,
+ })
+ public @interface EventId {
+ }
+
+ /** @hide */
public CaptivePortal(@NonNull IBinder binder) {
mBinder = binder;
}
@@ -170,7 +184,7 @@ public class CaptivePortal implements Parcelable {
*/
@SystemApi
@TestApi
- public void logEvent(int eventId, @NonNull String packageName) {
+ public void logEvent(@EventId int eventId, @NonNull String packageName) {
try {
ICaptivePortal.Stub.asInterface(mBinder).logEvent(eventId, packageName);
} catch (RemoteException e) {