rosemary: usb_gadget: Don't error when failing to write saving state

Change-Id: If5c7e7b98c4e130d1cb57a4a4168abc05d547e5d
Signed-off-by: bengris32 <bengris32@protonmail.ch>
This commit is contained in:
bengris32
2024-02-15 02:40:19 +00:00
parent 56773b97a4
commit 1c5d75b9bd

View File

@@ -229,11 +229,9 @@ static Status validateAndSetVidPid(int64_t functions) {
}
if (!saving.empty()) {
if (!WriteStringToFile(saving, SAVING_PATH)) {
ALOGE("Failed to update saving state");
ret = Status::ERROR;
ALOGW("Failed to update saving state");
}
}
error:
return ret;
}
@@ -343,10 +341,8 @@ ScopedAStatus UsbGadget::setCurrentUsbFunctions(long functions,
if (functions == GadgetFunction::NONE) {
// Make sure we reset saving state if there are no functions enabled.
if (!WriteStringToFile("0", SAVING_PATH)) {
ALOGE("Failed to reset saving state");
status = Status::ERROR;
}
if (!WriteStringToFile("0", SAVING_PATH))
ALOGW("Failed to reset saving state");
if (callback == NULL)
return ScopedAStatus::fromServiceSpecificErrorWithMessage(
-1, "callback == NULL");