Skip to content

Commit

Permalink
sr: Remove dialog usage from backup service
Browse files Browse the repository at this point in the history
Change-Id: I392c255e24080287a4c9ce8368e3064b15ec20ce
  • Loading branch information
Steve Kondik committed Sep 4, 2016
1 parent 9cccf8f commit c919095
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions bu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

#include "bu.h"

#include "messagesocket.h"

#include "voldclient.h"

#define PATHNAME_RC "/tmp/burc"
Expand All @@ -43,8 +41,6 @@ size_t hash_datalen;
SHA_CTX sha_ctx;
MD5_CTX md5_ctx;

static MessageSocket ms;

void
ui_print(const char* format, ...) {
char buffer[256];
Expand Down Expand Up @@ -178,7 +174,7 @@ int update_progress(uint64_t off)
if (now != last_time && pct != last_pct) {
char msg[256];
sprintf(msg, "%s: %d%% complete", curpart->name, pct);
ms.Show(msg);
ui_print(msg);
last_time = now;
last_pct = pct;
}
Expand Down Expand Up @@ -362,23 +358,19 @@ int main(int argc, char **argv)
vdc = new VoldClient();
vdc->start();

ms.ClientInit();

if (!strcmp(opname, "backup")) {
ms.Show("Backup in progress...");
ui_print("Backup in progress...");
rc = do_backup(argc-optidx, &argv[optidx]);
}
else if (!strcmp(opname, "restore")) {
ms.Show("Restore in progress...");
ui_print("Restore in progress...");
rc = do_restore(argc-optidx, &argv[optidx]);
}
else {
logmsg("Unknown operation %s\n", opname);
rc = 1;
}

ms.Dismiss();

xcomp_enable_set(xcomp_enable);

close(adb_ofd);
Expand Down

0 comments on commit c919095

Please sign in to comment.