VmTerminalApp: Show install error
It's currently limited to the debug build,
but it would be useful for end users as well.
This includes renaming to make usage clearer.
Bug: N/A
Test: Manually
Change-Id: I45fcbed9245362347bc9b640f48fed68536351f3
diff --git a/android/TerminalApp/java/com/android/virtualization/terminal/InstallerActivity.java b/android/TerminalApp/java/com/android/virtualization/terminal/InstallerActivity.java
index 0446866..34cb5c8 100644
--- a/android/TerminalApp/java/com/android/virtualization/terminal/InstallerActivity.java
+++ b/android/TerminalApp/java/com/android/virtualization/terminal/InstallerActivity.java
@@ -81,7 +81,7 @@
Intent intent = new Intent(this, InstallerService.class);
mInstallerServiceConnection = new InstallerServiceConnection(this);
if (!bindService(intent, mInstallerServiceConnection, Context.BIND_AUTO_CREATE)) {
- handleCriticalError(new Exception("Failed to connect to installer service"));
+ handleInternalError(new Exception("Failed to connect to installer service"));
}
}
@@ -125,7 +125,7 @@
snackbar.show();
}
- public void handleCriticalError(Exception e) {
+ public void handleInternalError(Exception e) {
if (Build.isDebuggable()) {
showSnackbar(
e.getMessage() + ". File a bugreport to go/ferrochrome-bug",
@@ -168,7 +168,7 @@
try {
mService.requestInstall();
} catch (RemoteException e) {
- handleCriticalError(e);
+ handleInternalError(e);
}
} else {
Log.d(TAG, "requestInstall() is called, but not yet connected");
@@ -193,20 +193,18 @@
setInstallEnabled(false);
}
} catch (RemoteException e) {
- handleCriticalError(e);
+ handleInternalError(e);
}
}
@MainThread
public void handleInstallerServiceDisconnected() {
- handleCriticalError(new Exception("InstallerService is destroyed while in use"));
+ handleInternalError(new Exception("InstallerService is destroyed while in use"));
}
@MainThread
- private void handleError(String displayText) {
- if (Build.isDebuggable()) {
- showSnackbar(displayText, Snackbar.LENGTH_LONG);
- }
+ private void handleInstallError(String displayText) {
+ showSnackbar(displayText, Snackbar.LENGTH_LONG);
setInstallEnabled(true);
}
@@ -246,7 +244,7 @@
return;
}
- activity.handleError(displayText);
+ activity.handleInstallError(displayText);
});
}
}
@@ -267,7 +265,7 @@
return;
}
if (service == null) {
- activity.handleCriticalError(new Exception("service shouldn't be null"));
+ activity.handleInternalError(new Exception("service shouldn't be null"));
}
activity.mService = IInstallerService.Stub.asInterface(service);