Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8beb2f19 authored by Lei Ju's avatar Lei Ju Committed by Android (Google) Code Review
Browse files

Merge "Register callback before calling other hal APIs"

parents 479d8b3f 84eb4f8d
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -370,11 +370,6 @@ public class ContextHubService extends IContextHubService.Stub {
            mLastRestartTimestampMap.put(contextHubId,
            mLastRestartTimestampMap.put(contextHubId,
                    new AtomicLong(SystemClock.elapsedRealtimeNanos()));
                    new AtomicLong(SystemClock.elapsedRealtimeNanos()));


            IContextHubClient client = mClientManager.registerClient(
                    contextHubInfo, createDefaultClientCallback(contextHubId),
                    /* attributionTag= */ null, mTransactionManager, mContext.getPackageName());
            defaultClientMap.put(contextHubId, client);

            try {
            try {
                mContextHubWrapper.registerCallback(contextHubId,
                mContextHubWrapper.registerCallback(contextHubId,
                        new ContextHubServiceCallback(contextHubId));
                        new ContextHubServiceCallback(contextHubId));
@@ -383,6 +378,11 @@ public class ContextHubService extends IContextHubService.Stub {
                        + contextHubId + ")", e);
                        + 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
            // Do a query to initialize the service cache list of nanoapps
            // TODO(b/194289715): Remove this when old API is deprecated
            // TODO(b/194289715): Remove this when old API is deprecated
            queryNanoAppsInternal(contextHubId);
            queryNanoAppsInternal(contextHubId);