Merge "Additional callback on binder's death." into sc-dev am: 628539a568
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13679454 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I3d56b09e2b0e5cb2def3c3dbfc56c814176048fe
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user