using android::snapshot::CancelResult; using android::snapshot::CreateResult; using android::snapshot::SnapshotManager;
bool IsCancelUpdateSafe(Device* device) { auto sm = SnapshotManager::New(); if (!sm) {
RecoveryUI* ui = device->GetUI();
ui->Print("Could not create SnapshotManager.\n"); returnfalse;
} return sm->IsCancelUpdateSafe();
}
bool FinishPendingSnapshotMerges(Device* device) { if (!android::base::GetBoolProperty("ro.virtual_ab.enabled", false)) { returntrue;
}
RecoveryUI* ui = device->GetUI(); auto sm = SnapshotManager::New(); if (!sm) {
ui->Print("Could not create SnapshotManager.\n"); returnfalse;
}
auto callback = [&]() -> void { double progress;
sm->GetUpdateState(&progress);
ui->Print("Waiting for merge to complete: %.2f\n", progress);
}; if (!sm->HandleImminentDataWipe(callback)) {
ui->Print("Unable to check merge status and/or complete update merge.\n"); returnfalse;
} returntrue;
}
bool CreateSnapshotPartitions() { if (!android::base::GetBoolProperty("ro.virtual_ab.enabled", false)) { // If the device does not support Virtual A/B, there's no need to create // snapshot devices. returntrue;
}
auto sm = SnapshotManager::New(); if (!sm) { // SnapshotManager could not be created. The device is still in a // consistent state and can continue with the mounting of the existing // devices, but cannot initialize snapshot devices.
LOG(WARNING) << "Could not create SnapshotManager"; returntrue;
}
auto ret = sm->RecoveryCreateSnapshotDevices(); if (ret == CreateResult::ERROR) { returnfalse;
} returntrue;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-07-01)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.