mirror of
https://github.com/Evolution-X-Devices/device_xiaomi_rosemary
synced 2026-01-27 07:49:58 +00:00
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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user