Log.i(TAG, "Service disconnected " + name);
}
};
- if (bindService(intent, conn, Context.BIND_AUTO_CREATE, 0)) {
+ if (bindServiceAsUser(intent, conn, Context.BIND_AUTO_CREATE, UserHandle.OWNER)) {
mConnections.add(conn);
} else {
Toast.makeText(ActivityTestMain.this, "Failed to bind",
Log.i(TAG, "Service disconnected " + name);
}
};
- if (bindService(intent, conn, Context.BIND_AUTO_CREATE, mSecondUser)) {
+ if (bindServiceAsUser(intent, conn, Context.BIND_AUTO_CREATE,
+ new UserHandle(mSecondUser))) {
mConnections.add(conn);
} else {
Toast.makeText(ActivityTestMain.this, "Failed to bind",