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

Commit 628539a5 authored by Alex Buynytskyy's avatar Alex Buynytskyy Committed by Android (Google) Code Review
Browse files

Merge "Additional callback on binder's death." into sc-dev

parents aa48846c 5e357b09
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;
        }