diff options
| author | Junyu Lai <junyulai@google.com> | 2021-11-02 06:52:46 +0000 |
|---|---|---|
| committer | Junyu Lai <junyulai@google.com> | 2021-12-13 06:26:07 +0000 |
| commit | 9d08a3ff2a07452ead5bbb7e97cfefda8e281c64 (patch) | |
| tree | fc4a0ce541a3f24046644a7adc4769251d0174ef /core/java | |
| parent | 40eb40302d0840a4637ddb264edcff84276e1a7b (diff) | |
[MS03] Remove ServiceNotFoundException hidden API usage
Since ServiceNotFoundException is not a system API. Remove
the unsupported interface which uses this exception.
This is safe since the method annotated with maxTargetSdk = R
and from dashboard it is not using by anybody.
Test: TH
Bug: 204830222
Change-Id: Ib8c0ce7b165732d24929851792d35371b90a5dfc
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/SystemServiceRegistry.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java index e2fd35940b52..aee7d0204c8c 100644 --- a/core/java/android/app/SystemServiceRegistry.java +++ b/core/java/android/app/SystemServiceRegistry.java @@ -129,6 +129,7 @@ import android.net.EthernetManager; import android.net.IEthernetManager; import android.net.IIpSecService; import android.net.INetworkPolicyManager; +import android.net.INetworkStatsService; import android.net.IPacProxyManager; import android.net.IVpnManager; import android.net.IpSecManager; @@ -991,7 +992,11 @@ public final class SystemServiceRegistry { new CachedServiceFetcher<NetworkStatsManager>() { @Override public NetworkStatsManager createService(ContextImpl ctx) throws ServiceNotFoundException { - return new NetworkStatsManager(ctx.getOuterContext()); + // TODO: Replace with an initializer in the module, see + // {@code ConnectivityFrameworkInitializer}. + final INetworkStatsService service = INetworkStatsService.Stub.asInterface( + ServiceManager.getServiceOrThrow(Context.NETWORK_STATS_SERVICE)); + return new NetworkStatsManager(ctx.getOuterContext(), service); }}); registerService(Context.PERSISTENT_DATA_BLOCK_SERVICE, PersistentDataBlockManager.class, |
