Fix switching from b slot to a slot -- Fixes https://github.com/phhusson/treble_experimentations/issues/2408
This commit is contained in:
parent
0c5eaf7d25
commit
5b3edfaf9d
@ -41,11 +41,9 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
if(argc>=2 && strcmp(argv[1], "new-slot") == 0) {
|
||||
std::string current_slot;
|
||||
std::string next_slot;
|
||||
if(!android::base::ReadFileToString("/metadata/phh/img", ¤t_slot)) {
|
||||
next_slot = "a";
|
||||
} else {
|
||||
if(current_slot.c_str()[0] == 'a')
|
||||
std::string next_slot = "a";
|
||||
if(android::base::ReadFileToString("/metadata/phh/img", ¤t_slot) &&
|
||||
current_slot.c_str()[0] == 'a') {
|
||||
next_slot = "b";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user