Skip to content

Commit

Permalink
avbctl: Remove comment and code about ro.boot.slot.
Browse files Browse the repository at this point in the history
The presence of this comment and code is confusing as only
ro.boot.slot_suffix is used and this will always have a leading
underscore. Remove it.

Bug: 37663204
Test: All unit tests pass.
Change-Id: I824626c0c6d8b7ed2b19cca495c533a6e202fa24
  • Loading branch information
davidz25 committed Sep 20, 2017
1 parent f227176 commit 2f6ce43
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions tools/avbctl/avbctl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,21 +220,9 @@ int do_get_verity(AvbOps* ops, const std::string& ab_suffix) {
/* Helper function to get A/B suffix, if any. If the device isn't
* using A/B the empty string is returned. Otherwise either "_a",
* "_b", ... is returned.
*
* Note that since sometime in O androidboot.slot_suffix is deprecated
* and androidboot.slot should be used instead. Since bootloaders may
* be out of sync with the OS, we check both and for extra safety
* prepend a leading underscore if there isn't one already.
*/
std::string get_ab_suffix() {
std::string ab_suffix = android::base::GetProperty("ro.boot.slot_suffix", "");
if (ab_suffix == "") {
ab_suffix = android::base::GetProperty("ro.boot.slot", "");
}
if (ab_suffix.size() > 0 && ab_suffix[0] != '_') {
ab_suffix = std::string("_") + ab_suffix;
}
return ab_suffix;
return android::base::GetProperty("ro.boot.slot_suffix", "");
}

} // namespace
Expand Down

0 comments on commit 2f6ce43

Please sign in to comment.