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

Commit 303e42fb authored by Yifei Zhang's avatar Yifei Zhang
Browse files

contexthub: fix NPE at handleServiceRestart

NPE is possible when mHubInfoRegistry doesn't exist. Skip recovery
logic.

Bug: 386842901
Test: build
Flag: EXEMPT, bug fix
Change-Id: I85525b8d3fc6e704b4f68ad2f31fbfcb458d3f2d
parent 9330fc99
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -256,7 +256,9 @@ public class ContextHubService extends IContextHubService.Stub {
        public void handleServiceRestart() {
            Log.i(TAG, "Recovering from Context Hub HAL restart...");
            initExistingCallbacks();
            if (mHubInfoRegistry != null) {
                mHubInfoRegistry.onHalRestart();
            }
            resetSettings();
            if (Flags.reconnectHostEndpointsAfterHalRestart()) {
                mClientManager.forEachClientOfHub(mContextHubId,