diff options
| author | 2023-02-15 16:31:49 -0800 | |
|---|---|---|
| committer | 2023-02-23 12:05:29 -0800 | |
| commit | 92e8b01449d010080c5651959b274364a5dbeb96 (patch) | |
| tree | 4e493453606f6f4007fc0d65c9bbc269b589e0c8 | |
| parent | 9007d0a77e62da8bcb3382da31dfd2867b198bb0 (diff) | |
Register callback before calling other hal APIs
Test: manual test on a device
Bug: 269525639
Change-Id: I97944079d78c1723a5422e7ac9b019ce61aaafbd
Merged-In: I97944079d78c1723a5422e7ac9b019ce61aaafbd
| -rw-r--r-- | services/core/java/com/android/server/location/contexthub/ContextHubService.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/location/contexthub/ContextHubService.java b/services/core/java/com/android/server/location/contexthub/ContextHubService.java index 8f657756eed3..25fd5eaed5a4 100644 --- a/services/core/java/com/android/server/location/contexthub/ContextHubService.java +++ b/services/core/java/com/android/server/location/contexthub/ContextHubService.java @@ -370,11 +370,6 @@ public class ContextHubService extends IContextHubService.Stub { mLastRestartTimestampMap.put(contextHubId, new AtomicLong(SystemClock.elapsedRealtimeNanos())); - IContextHubClient client = mClientManager.registerClient( - contextHubInfo, createDefaultClientCallback(contextHubId), - /* attributionTag= */ null, mTransactionManager, mContext.getPackageName()); - defaultClientMap.put(contextHubId, client); - try { mContextHubWrapper.registerCallback(contextHubId, new ContextHubServiceCallback(contextHubId)); @@ -383,6 +378,11 @@ public class ContextHubService extends IContextHubService.Stub { + contextHubId + ")", e); } + IContextHubClient client = mClientManager.registerClient( + contextHubInfo, createDefaultClientCallback(contextHubId), + /* attributionTag= */ null, mTransactionManager, mContext.getPackageName()); + defaultClientMap.put(contextHubId, client); + // Do a query to initialize the service cache list of nanoapps // TODO(b/194289715): Remove this when old API is deprecated queryNanoAppsInternal(contextHubId); |