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

Commit 863cc6d3 authored by Atneya Nair's avatar Atneya Nair Committed by Automerger Merge Worker
Browse files

Merge "Catch STHAL factory exceptions" into udc-dev am: 4d1298ee

parents 572c813d 4d1298ee
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -168,9 +168,18 @@ class SoundTriggerModule implements IBinder.DeathRecipient, ISoundTriggerHal.Glo
     * Attached to the HAL service via factory.
     */
    private void attachToHal() {
        mHalService = null;
        while (mHalService == null) {
            try {
                mHalService = new SoundTriggerHalEnforcer(
                        new SoundTriggerHalWatchdog(
                            new SoundTriggerDuplicateModelHandler(mHalFactory.create())));
            } catch (RuntimeException e) {
                if (!(e.getCause() instanceof RemoteException)) {
                    throw e;
                }
            }
        }
        mHalService.linkToDeath(this);
        mHalService.registerCallback(this);
        mProperties = mHalService.getProperties();