From 846e49943d9ba7cacc475d67ba0150b13f44cb78 Mon Sep 17 00:00:00 2001 From: markchien Date: Mon, 11 Mar 2019 11:56:13 +0800 Subject: [PATCH] Remove deprecated entitlement API The deprecated entitlement APIs[1] is introduced in the Q development cycle. It should be replaced by new APIs[2][3]. [1] https://android-review.googlesource.com/c/platform/frameworks/base/+/874220 [2] https://android-review.googlesource.com/c/platform/frameworks/base/+/920354 [3] https://android-review.googlesource.com/c/platform/frameworks/base/+/927513 Test: -build, flash, boot bug: 126701557 bug: 126392011 Change-Id: I96487e9038c07363680a76db840994719d7ff768 --- api/removed.txt | 6 --- .../java/android/net/ConnectivityManager.java | 42 ------------------- 2 files changed, 48 deletions(-) diff --git a/api/removed.txt b/api/removed.txt index d6169cbd883a3..72202ad9712a0 100644 --- a/api/removed.txt +++ b/api/removed.txt @@ -304,17 +304,11 @@ package android.media.tv { package android.net { public class ConnectivityManager { - method @Deprecated public void getLatestTetheringEntitlementValue(int, boolean, @NonNull android.net.ConnectivityManager.TetheringEntitlementValueListener, @Nullable android.os.Handler); method @Deprecated public boolean requestRouteToHost(int, int); method @Deprecated public int startUsingNetworkFeature(int, String); method @Deprecated public int stopUsingNetworkFeature(int, String); } - @Deprecated public abstract static class ConnectivityManager.TetheringEntitlementValueListener { - ctor public ConnectivityManager.TetheringEntitlementValueListener(); - method public void onEntitlementResult(int); - } - @Deprecated public class NetworkBadging { method @NonNull public static android.graphics.drawable.Drawable getWifiIcon(@IntRange(from=0, to=4) int, int, @Nullable android.content.res.Resources.Theme); field public static final int BADGING_4K = 30; // 0x1e diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index 2a357ff2bcbbe..cd9a56aecf8f5 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -2808,23 +2808,6 @@ public class ConnectivityManager { void onTetheringEntitlementResult(@EntitlementResultCode int resultCode); } - /** - * @removed - * @deprecated This API would be removed when all of caller has been updated. - * */ - @Deprecated - public abstract static class TetheringEntitlementValueListener { - /** - * Called to notify entitlement result. - * - * @param resultCode a int value of entitlement result. It may be one of - * {@link #TETHER_ERROR_NO_ERROR}, - * {@link #TETHER_ERROR_PROVISION_FAILED}, or - * {@link #TETHER_ERROR_ENTITLEMENT_UNKONWN}. - */ - public void onEntitlementResult(int resultCode) {} - } - /** * Get the last value of the entitlement check on this downstream. If the cached value is * {@link #TETHER_ERROR_NO_ERROR} or showEntitlementUi argument is false, it just return the @@ -2870,31 +2853,6 @@ public class ConnectivityManager { } } - /** - * @removed - * @deprecated This API would be removed when all of caller has been updated. - * */ - @Deprecated - public void getLatestTetheringEntitlementValue(int type, boolean showEntitlementUi, - @NonNull final TetheringEntitlementValueListener listener, @Nullable Handler handler) { - Preconditions.checkNotNull(listener, "TetheringEntitlementValueListener cannot be null."); - ResultReceiver wrappedListener = new ResultReceiver(handler) { - @Override - protected void onReceiveResult(int resultCode, Bundle resultData) { - listener.onEntitlementResult(resultCode); - } - }; - - try { - String pkgName = mContext.getOpPackageName(); - Log.i(TAG, "getLatestTetheringEntitlementValue:" + pkgName); - mService.getLatestTetheringEntitlementResult(type, wrappedListener, - showEntitlementUi, pkgName); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } - } - /** * Report network connectivity status. This is currently used only * to alter status bar UI.