rename stop_vm_launcher_service to shutdown_vm
... because what it actually does is shutting down the VM, not stopping
the Android service. Stopping the service is indirectly done after the
VM shutdown is finished.
Bug: N/A
Test: N/A
Change-Id: Iac83717b769c5c2691ef1473887aa8fb2933b28e
diff --git a/android/TerminalApp/java/com/android/virtualization/terminal/MainActivity.kt b/android/TerminalApp/java/com/android/virtualization/terminal/MainActivity.kt
index 662fef5..24daa26 100644
--- a/android/TerminalApp/java/com/android/virtualization/terminal/MainActivity.kt
+++ b/android/TerminalApp/java/com/android/virtualization/terminal/MainActivity.kt
@@ -328,7 +328,7 @@
val stopIntent = Intent()
stopIntent.setClass(this, VmLauncherService::class.java)
- stopIntent.setAction(VmLauncherService.ACTION_STOP_VM_LAUNCHER_SERVICE)
+ stopIntent.setAction(VmLauncherService.ACTION_SHUTDOWN_VM)
val stopPendingIntent =
PendingIntent.getService(
this,
diff --git a/android/TerminalApp/java/com/android/virtualization/terminal/VmLauncherService.kt b/android/TerminalApp/java/com/android/virtualization/terminal/VmLauncherService.kt
index 05b387f..ec0fd50 100644
--- a/android/TerminalApp/java/com/android/virtualization/terminal/VmLauncherService.kt
+++ b/android/TerminalApp/java/com/android/virtualization/terminal/VmLauncherService.kt
@@ -170,7 +170,7 @@
}
override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
- if (intent.action == ACTION_STOP_VM_LAUNCHER_SERVICE) {
+ if (intent.action == ACTION_SHUTDOWN_VM) {
if (debianService != null && debianService!!.shutdownDebian()) {
// During shutdown, change the notification content to indicate that it's closing
val notification = createNotificationForTerminalClose()
@@ -301,7 +301,7 @@
private fun createNotificationForTerminalClose(): Notification {
val stopIntent = Intent()
stopIntent.setClass(this, VmLauncherService::class.java)
- stopIntent.setAction(ACTION_STOP_VM_LAUNCHER_SERVICE)
+ stopIntent.setAction(ACTION_SHUTDOWN_VM)
val stopPendingIntent =
PendingIntent.getService(
this,
@@ -469,8 +469,7 @@
private const val ACTION_START_VM_LAUNCHER_SERVICE =
"android.virtualization.START_VM_LAUNCHER_SERVICE"
const val EXTRA_DISPLAY_INFO = "EXTRA_DISPLAY_INFO"
- const val ACTION_STOP_VM_LAUNCHER_SERVICE: String =
- "android.virtualization.STOP_VM_LAUNCHER_SERVICE"
+ const val ACTION_SHUTDOWN_VM: String = "android.virtualization.ACTION_SHUTDOWN_VM"
private const val RESULT_START = 0
private const val RESULT_STOP = 1
@@ -542,7 +541,7 @@
fun stop(context: Context) {
val i = getMyIntent(context)
- i.setAction(ACTION_STOP_VM_LAUNCHER_SERVICE)
+ i.setAction(ACTION_SHUTDOWN_VM)
context.startService(i)
}
}