From 1c7789742b5cf0a9d56e27b95bd0c49bb3fbd590 Mon Sep 17 00:00:00 2001 From: lifr Date: Tue, 2 Mar 2021 17:12:27 +0800 Subject: [PATCH] [CS05]Remove the hidden API usage of MetricsLogger Legacy metrics are unused and deprecated, so they are being removed. Therefore, delete the usage of the hidden MetricsLogger API. Bug: 157966864 Test: atest CtsNetTestCases atest CaptivePortalTest atest ConnectivityServiceTest Change-Id: I51241f5d50ec580015882c84dd917b015c700c7c --- framework/api/system-current.txt | 2 +- framework/src/android/net/CaptivePortal.java | 7 +++---- framework/src/android/net/ICaptivePortal.aidl | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/framework/api/system-current.txt b/framework/api/system-current.txt index 373fa3c240..f5972fa340 100644 --- a/framework/api/system-current.txt +++ b/framework/api/system-current.txt @@ -2,7 +2,7 @@ package android.net { public class CaptivePortal implements android.os.Parcelable { - method public void logEvent(int, @NonNull String); + method @Deprecated public void logEvent(int, @NonNull String); method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void reevaluateNetwork(); method public void useNetwork(); field public static final int APP_REQUEST_REEVALUATION_REQUIRED = 100; // 0x64 diff --git a/framework/src/android/net/CaptivePortal.java b/framework/src/android/net/CaptivePortal.java index 269bbf20c8..4a7b601642 100644 --- a/framework/src/android/net/CaptivePortal.java +++ b/framework/src/android/net/CaptivePortal.java @@ -160,12 +160,11 @@ public class CaptivePortal implements Parcelable { * @param eventId one of the CAPTIVE_PORTAL_LOGIN_* constants in metrics_constants.proto. * @param packageName captive portal application package name. * @hide + * @deprecated The event will not be logged in Android S and above. The + * caller is migrating to statsd. */ + @Deprecated @SystemApi public void logEvent(int eventId, @NonNull String packageName) { - try { - ICaptivePortal.Stub.asInterface(mBinder).logEvent(eventId, packageName); - } catch (RemoteException e) { - } } } diff --git a/framework/src/android/net/ICaptivePortal.aidl b/framework/src/android/net/ICaptivePortal.aidl index fe21905c70..e35f8d46af 100644 --- a/framework/src/android/net/ICaptivePortal.aidl +++ b/framework/src/android/net/ICaptivePortal.aidl @@ -23,5 +23,4 @@ package android.net; oneway interface ICaptivePortal { void appRequest(int request); void appResponse(int response); - void logEvent(int eventId, String packageName); }