../../system/update_engine/binder_bindings/android/os/IUpdateEngineCallback.aidl \
LOCAL_SRC_FILES += \
+ ../../system/core/storaged/binder/android/os/IStoraged.aidl \
../../system/netd/server/binder/android/net/INetd.aidl \
../../system/vold/binder/android/os/IVold.aidl \
../../system/vold/binder/android/os/IVoldListener.aidl \
frameworks/av/drm/libmediadrm/aidl \
frameworks/av/media/libaudioclient/aidl \
frameworks/native/aidl/gui \
+ system/core/storaged/binder \
system/netd/server/binder \
system/vold/binder \
system/bt/binder
LOCAL_AIDL_INCLUDES := \
frameworks/native/aidl/binder \
+ system/core/storaged/binder \
system/netd/server/binder \
system/vold/binder
$(call all-java-files-under,java) \
java/com/android/server/EventLogTags.logtags \
java/com/android/server/am/EventLogTags.logtags \
+ ../../../../system/core/storaged/binder/android/os/IStoraged.aidl \
../../../../system/netd/server/binder/android/net/INetd.aidl \
../../../../system/netd/server/binder/android/net/metrics/INetdEventListener.aidl \
../../../../system/vold/binder/android/os/IVold.aidl \
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
+import android.os.IStoraged;
import android.os.IVold;
import android.os.IVoldListener;
import android.os.IVoldTaskListener;
private final Context mContext;
private volatile IVold mVold;
+ private volatile IStoraged mStoraged;
private volatile boolean mSystemReady = false;
private volatile boolean mBootCompleted = false;
}
for (int userId : systemUnlockedUsers) {
mVold.onUserStarted(userId);
+ mStoraged.onUserStarted(userId);
}
} catch (Exception e) {
Slog.wtf(TAG, e);
// bind mount against.
try {
mVold.onUserStarted(userId);
+ mStoraged.onUserStarted(userId);
} catch (Exception e) {
Slog.wtf(TAG, e);
}
try {
mVold.onUserStopped(userId);
+ mStoraged.onUserStopped(userId);
} catch (Exception e) {
Slog.wtf(TAG, e);
}
}
private void connect() {
- IBinder binder = ServiceManager.getService("vold");
+ IBinder binder = ServiceManager.getService("storaged");
+ if (binder != null) {
+ try {
+ binder.linkToDeath(new DeathRecipient() {
+ @Override
+ public void binderDied() {
+ Slog.w(TAG, "storaged died; reconnecting");
+ mStoraged = null;
+ connect();
+ }
+ }, 0);
+ } catch (RemoteException e) {
+ binder = null;
+ }
+ }
+
+ if (binder != null) {
+ mStoraged = IStoraged.Stub.asInterface(binder);
+ } else {
+ Slog.w(TAG, "storaged not found; trying again");
+ }
+
+ binder = ServiceManager.getService("vold");
if (binder != null) {
try {
binder.linkToDeath(new DeathRecipient() {
@Override
public void binderDied() {
Slog.w(TAG, "vold died; reconnecting");
+ mVold = null;
connect();
}
}, 0);
mVold = IVold.Stub.asInterface(binder);
try {
mVold.setListener(mListener);
- onDaemonConnected();
- return;
} catch (RemoteException e) {
+ mVold = null;
Slog.w(TAG, "vold listener rejected; trying again", e);
}
} else {
Slog.w(TAG, "vold not found; trying again");
}
- BackgroundThread.getHandler().postDelayed(() -> {
- connect();
- }, DateUtils.SECOND_IN_MILLIS);
+ if (mStoraged == null || mVold == null) {
+ BackgroundThread.getHandler().postDelayed(() -> {
+ connect();
+ }, DateUtils.SECOND_IN_MILLIS);
+ } else {
+ onDaemonConnected();
+ }
}
private void systemReady() {