Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4bfcfe79 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Add Intdef annotation for eventId in logEvent" am: 3fa7b283 am: 0dbbbdf4 am: bf3b4214

Change-Id: I7caa207fb35e8088e50de0651a72a6d9628e7ce2
parents 83d9034a bf3b4214
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -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
@@ -76,6 +79,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) {