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

Commit 1c793f6d authored by Hyunyoung Song's avatar Hyunyoung Song
Browse files

Handle NoSuchElementException inside SmartSpaceService

Bug: 258772595
Test: manually kill aiai when CallbackWrapper is constructed
Flag: EXEMPT bugfix

Change-Id: I270d7ac4d9711fc37c910a6ee0f43c70c97a1c75
parent afbfbaf9
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import android.util.Slog;

import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.function.Consumer;

/**
@@ -321,9 +322,13 @@ public abstract class SmartspaceService extends Service {
        }

        public void destroy() {
            try {
                if (mCallback != null && mOnBinderDied != null) {
                    mCallback.asBinder().unlinkToDeath(this, 0);
                }
            } catch (NoSuchElementException e) {
                Slog.e(TAG, "Error trying to unlink to death:" + e);
            }
        }

        @Override