Skip to content

Commit f85c8ca

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 2359194 commit f85c8ca

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
@@ -175,12 +175,12 @@ internal class ImageArchive {
175175
}
176176

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public class InstallerActivity : BaseActivity() {
109109
override fun onResume() {
110110
super.onResume()
111111

112-
if (autoInstall || (Build.isDebuggable() && fromSdCard().exists())) {
112+
if (autoInstall || fromSdCard().exists()) {
113113
showSnackBar("Auto installing", Snackbar.LENGTH_LONG)
114114
requestInstall()
115115
}

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)