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

Commit 95ebdf39 authored by Sandeep Bandaru's avatar Sandeep Bandaru
Browse files

Fixing NPE before calling unbind

Test: CTS
Bug: n/a
Change-Id: I63584cc9b7c084df28da4113f871f865c81d4054
parent ef54218e
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -539,10 +539,14 @@ public class OnDeviceIntelligenceManagerService extends SystemService {
                Manifest.permission.USE_ON_DEVICE_INTELLIGENCE, TAG);
        synchronized (mLock) {
            mTemporaryServiceNames = componentNames;
            if (mRemoteInferenceService != null) {
                mRemoteInferenceService.unbind();
                mRemoteInferenceService = null;
            }
            if (mRemoteOnDeviceIntelligenceService != null) {
                mRemoteOnDeviceIntelligenceService.unbind();
                mRemoteOnDeviceIntelligenceService = null;
            mRemoteInferenceService = null;
            }
            if (mTemporaryHandler == null) {
                mTemporaryHandler = new Handler(Looper.getMainLooper(), null, true) {
                    @Override