From f6e38704614ed1aac4dbae1e05f102ec63c2ccc5 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 30 Jul 2021 11:17:25 -0700 Subject: [PATCH] UwbManager: Change initialization mechanism for uwb service Needed since UWB is going to be delivered via apex. Bug: 194906542 Test: Compiles Change-Id: I78e5b41601d665fb8fd2b96d9b86429404bd2ce0 --- core/api/system-current.txt | 1 + core/java/android/app/SystemServiceRegistry.java | 11 ++--------- core/java/android/content/Context.java | 1 + 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 82b032a05c095..711d6c53f5da0 100755 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -2354,6 +2354,7 @@ package android.content { field public static final String TETHERING_SERVICE = "tethering"; field public static final String TRANSLATION_MANAGER_SERVICE = "translation"; field public static final String UI_TRANSLATION_SERVICE = "ui_translation"; + field public static final String UWB_SERVICE = "uwb"; field public static final String VR_SERVICE = "vrmanager"; field public static final String WIFI_NL80211_SERVICE = "wifinl80211"; field @Deprecated public static final String WIFI_RTT_SERVICE = "rttmanager"; diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java index 32ea41b2c75f5..8ac8229042ad9 100644 --- a/core/java/android/app/SystemServiceRegistry.java +++ b/core/java/android/app/SystemServiceRegistry.java @@ -205,7 +205,7 @@ import android.telephony.TelephonyRegistryManager; import android.util.ArrayMap; import android.util.Log; import android.util.Slog; -import android.uwb.UwbManager; +import android.uwb.UwbFrameworkInitializer; import android.view.ContextThemeWrapper; import android.view.LayoutInflater; import android.view.WindowManager; @@ -728,14 +728,6 @@ public final class SystemServiceRegistry { return new SerialManager(ctx, ISerialManager.Stub.asInterface(b)); }}); - registerService(Context.UWB_SERVICE, UwbManager.class, - new CachedServiceFetcher() { - @Override - public UwbManager createService(ContextImpl ctx) { - return UwbManager.getInstance(ctx); - } - }); - registerService(Context.VIBRATOR_MANAGER_SERVICE, VibratorManager.class, new CachedServiceFetcher() { @Override @@ -1486,6 +1478,7 @@ public final class SystemServiceRegistry { MediaFrameworkInitializer.registerServiceWrappers(); RoleFrameworkInitializer.registerServiceWrappers(); SchedulingFrameworkInitializer.registerServiceWrappers(); + UwbFrameworkInitializer.registerServiceWrappers(); } finally { // If any of the above code throws, we're in a pretty bad shape and the process // will likely crash, but we'll reset it just in case there's an exception handler... diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index ac88c7bdcb184..46f35b6dc99b1 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -5606,6 +5606,7 @@ public abstract class Context { * @see #getSystemService(String) * @hide */ + @SystemApi public static final String UWB_SERVICE = "uwb"; /**