Skip to content

Commit 83ded96

Browse files
committed
ImageArchive: allow sdcard images even when os is not debuggable
This allows custom images on production gos builds, to allow the user to run a different os of their choosing Users can place images into /storage/emulated/0/linux/images.tar.gz
1 parent b0ab840 commit 83ded96

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

android/TerminalApp/java/com/android/virtualization/terminal/ImageArchive.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ internal class ImageArchive {
176176
}
177177

178178
/**
179-
* Creates ImageArchive from either SdCard or Internet. SdCard is used only when the build
180-
* is debuggable and the file actually exists.
179+
* Creates ImageArchive from either SdCard or Internet. SdCard is used only when the
180+
* file actually exists.
181181
*/
182182
fun getDefault(): ImageArchive {
183183
val archive = fromSdCard()
184-
return if (Build.isDebuggable() && archive.exists()) {
184+
return if (archive.exists()) {
185185
archive
186186
} else {
187187
fromInternet()

android/TerminalApp/java/com/android/virtualization/terminal/InstallerActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public class InstallerActivity : BaseActivity() {
101101
override fun onResume() {
102102
super.onResume()
103103

104-
if (Build.isDebuggable() && fromSdCard().exists()) {
104+
if (fromSdCard().exists()) {
105105
showSnackBar("Auto installing", Snackbar.LENGTH_LONG)
106106
requestInstall()
107107
}

android/TerminalApp/java/com/android/virtualization/terminal/InstallerService.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@ class InstallerService : Service() {
152152
val archive = fromSdCard()
153153
val archive_path = archive.getPath()
154154

155-
// Installing from sdcard is preferred, but only supported only in debuggable build.
156-
if (!Build.isDebuggable()) {
157-
Log.i(TAG, "Non-debuggable build doesn't support installation from $archive_path")
158-
return false
159-
}
160155
if (!archive.exists()) {
161156
return false
162157
}

0 commit comments

Comments
 (0)