summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorChalard Jean <jchalard@google.com>2021-10-27 07:04:16 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-10-27 07:04:16 +0000
commitfbf7614d0875cfb897c3bdecbdb127562ce6bfae (patch)
tree8691a346b384604b48e3c55bdcd1f267a90662ae /core/java/android
parentdbe9f5aed801e99d74f27988e9a23055cae83c78 (diff)
parent62f13c3f07fae758a19e431213fcd63f89b2fd7f (diff)
Merge "Remove the static application context fetcher" am: 35cbd1d5ee am: ac2bc495f5 am: 4afb2fa833 am: 9bdb13089e am: 62f13c3f07
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1870453 Change-Id: Ic58d0d022593350a010c9fae9ab1a41a26dc3917
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/SystemServiceRegistry.java33
1 files changed, 0 insertions, 33 deletions
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index 8ea1f8315b89..40c19788ae5d 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -1925,39 +1925,6 @@ public final class SystemServiceRegistry {
public abstract T createService() throws ServiceNotFoundException;
}
- /**
- * Like StaticServiceFetcher, creates only one instance of the service per application, but when
- * creating the service for the first time, passes it the application context of the creating
- * application.
- *
- * TODO: Delete this once its only user (ConnectivityManager) is known to work well in the
- * case where multiple application components each have their own ConnectivityManager object.
- */
- static abstract class StaticApplicationContextServiceFetcher<T> implements ServiceFetcher<T> {
- private T mCachedInstance;
-
- @Override
- public final T getService(ContextImpl ctx) {
- synchronized (StaticApplicationContextServiceFetcher.this) {
- if (mCachedInstance == null) {
- Context appContext = ctx.getApplicationContext();
- // If the application context is null, we're either in the system process or
- // it's the application context very early in app initialization. In both these
- // cases, the passed-in ContextImpl will not be freed, so it's safe to pass it
- // to the service. http://b/27532714 .
- try {
- mCachedInstance = createService(appContext != null ? appContext : ctx);
- } catch (ServiceNotFoundException e) {
- onServiceNotFound(e);
- }
- }
- return mCachedInstance;
- }
- }
-
- public abstract T createService(Context applicationContext) throws ServiceNotFoundException;
- }
-
/** @hide */
public static void onServiceNotFound(ServiceNotFoundException e) {
// We're mostly interested in tracking down long-lived core system