Merge AOSP android-9.0.0_r3
Fix conflicts and make it build in 5.1, 6.0, 7.1, 8.1, and 9.0
Change-Id: Ida0a64c29ff27d339b7f42a18d820930964ac6e4
diff --git a/adbbu/adbbumain.cpp b/adbbu/adbbumain.cpp
index 2e66bce..bd96b20 100644
--- a/adbbu/adbbumain.cpp
+++ b/adbbu/adbbumain.cpp
@@ -32,9 +32,9 @@
int main(int argc, char **argv) {
int index;
- int pos = 0;
+ size_t pos = 0;
bool ret = false;
- int maxpos = sizeof(TWRPARG + 2);
+ size_t maxpos = strlen(TWRPARG) + 2;
std::string command;
twrpback tw;
@@ -45,10 +45,10 @@
}
pos = command.find(TWRP_BACKUP_ARG);
- if (pos < 0 || pos > (maxpos + sizeof(TWRP_BACKUP_ARG) + 1)) {
+ if (pos == std::string::npos || pos > (maxpos + strlen(TWRP_BACKUP_ARG) + 1)) {
pos = command.find(TWRP_RESTORE_ARG);
}
- if (pos < 0 || pos > maxpos + sizeof(TWRP_STREAM_ARG + 1)) {
+ if (pos == std::string::npos || pos > maxpos + strlen(TWRP_STREAM_ARG) + 1) {
pos = command.find(TWRP_STREAM_ARG);
}