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

Commit 53f6e861 authored by Varun Shah's avatar Varun Shah
Browse files

Catch NoSuchElementException in SyncManager.

There is a possibility that the sync adapter active context
was never registered with the IBinder so we can get an exception
while unbinding the service - catch the exception and log a wtf
when this occurs.

Fixes: 350602913
Test: builds/flashes
Flag: EXEMPT bugfix
Change-Id: I691e825c5b88222bcff174e8dc4751e53f1a3df2
parent 0e4056a7
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2158,8 +2158,12 @@ public class SyncManager {
            }
            if (mBound) {
                mBound = false;
                try {
                    mLogger.log("unbindService for ", this);
                    mContext.unbindService(this);
                } catch (NoSuchElementException e) {
                    Slog.wtf(TAG, "Failed to unlink active sync adapter on close()", e);
                }
                try {
                    mBatteryStats.noteSyncFinish(mEventName, mSyncAdapterUid);
                } catch (RemoteException e) {