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

Commit 87eea028 authored by Alex Buynytskyy's avatar Alex Buynytskyy Committed by Automerger Merge Worker
Browse files

Merge "Additional callback on binder's death." into sc-dev am: 628539a5

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13679454

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I11bdf8b2de99ed94dc24c9778fe4c729da902f0a
parents 0093fe51 628539a5
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@ public class DataLoaderManagerService extends SystemService {
        }
    }

    private class DataLoaderServiceConnection implements ServiceConnection {
    private class DataLoaderServiceConnection implements ServiceConnection, IBinder.DeathRecipient {
        final int mId;
        final IDataLoaderStatusListener mListener;
        IDataLoader mDataLoader;
@@ -194,6 +194,13 @@ public class DataLoaderManagerService extends SystemService {
                mContext.unbindService(this);
                return;
            }
            try {
                service.linkToDeath(this, /*flags=*/0);
            } catch (RemoteException e) {
                Slog.e(TAG, "Failed to link to DataLoader's death: " + mId, e);
                onBindingDied(className);
                return;
            }
            callListener(IDataLoaderStatusListener.DATA_LOADER_BOUND);
        }

@@ -218,6 +225,13 @@ public class DataLoaderManagerService extends SystemService {
            destroy();
        }

        @Override
        public void binderDied() {
            Slog.i(TAG, "DataLoader " + mId + " died");
            callListener(IDataLoaderStatusListener.DATA_LOADER_DESTROYED);
            destroy();
        }

        IDataLoader getDataLoader() {
            return mDataLoader;
        }