Skip to content

Commit 596e1a0

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 cd7cf6f commit 596e1a0

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
@@ -173,12 +173,12 @@ internal class ImageArchive {
173173
}
174174

175175
/**
176-
* Creates ImageArchive from either SdCard or Internet. SdCard is used only when the build
177-
* is debuggable and the file actually exists.
176+
* Creates ImageArchive from either SdCard or Internet. SdCard is used only when the
177+
* file actually exists.
178178
*/
179179
fun getDefault(): ImageArchive {
180180
val archive = fromSdCard()
181-
return if (Build.isDebuggable() && archive.exists()) {
181+
return if (archive.exists()) {
182182
archive
183183
} else {
184184
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)