mirror of
https://github.com/openharmony/ability_ability_runtime.git
synced 2026-08-24 12:43:16 -04:00
@@ -1813,9 +1813,15 @@ int AbilityManagerProxy::StopUser(int userId, const sptr<IStopUserCallback> &cal
|
||||
HILOG_ERROR("StopUser:WriteInt32 fail.");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
if (!data.WriteParcelable(callback->AsObject())) {
|
||||
HILOG_ERROR("StopUser:write IStopUserCallback fail.");
|
||||
return ERR_INVALID_VALUE;
|
||||
|
||||
if (!callback) {
|
||||
data.WriteBool(false);
|
||||
} else {
|
||||
data.WriteBool(true);
|
||||
if (!data.WriteParcelable(callback->AsObject())) {
|
||||
HILOG_ERROR("StopUser:write IStopUserCallback fail.");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
}
|
||||
error = Remote()->SendRequest(IAbilityManager::STOP_USER, data, reply, option);
|
||||
if (error != NO_ERROR) {
|
||||
|
||||
@@ -1066,7 +1066,10 @@ int AbilityManagerStub::StartUserInner(MessageParcel &data, MessageParcel &reply
|
||||
int AbilityManagerStub::StopUserInner(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
int32_t userId = data.ReadInt32();
|
||||
auto callback = iface_cast<IStopUserCallback>(data.ReadParcelable<IRemoteObject>());
|
||||
sptr<IStopUserCallback> callback = nullptr;
|
||||
if (data.ReadBool()) {
|
||||
callback = iface_cast<IStopUserCallback>(data.ReadParcelable<IRemoteObject>());
|
||||
}
|
||||
int result = StopUser(userId, callback);
|
||||
if (!reply.WriteInt32(result)) {
|
||||
HILOG_ERROR("StopUser failed.");
|
||||
|
||||
Reference in New Issue
Block a user