void MoveStorage(const std::shared_ptr<VolumeBase>& from, const std::shared_ptr<VolumeBase>& to,
const android::sp<android::os::IVoldTaskListener>& listener) {
- android::wakelock::WakeLock wl{kWakeLock};
+ auto wl = android::wakelock::WakeLock::tryGet(kWakeLock);
+ if (!wl.has_value()) {
+ return;
+ }
android::os::PersistableBundle extras;
status_t res = moveStorageInternal(from, to, listener);