SessionInstaller: Open write sessions with packageName only
This allows to open same sessions multiple times when required untill it's abandoned. Also specifiy file length as it is known. Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -139,7 +139,7 @@ class SessionInstaller(context: Context) : InstallerBase(context) {
|
||||
Log.i("Writing splits to session for $packageName")
|
||||
getFiles(packageName, versionCode, sharedLibPkgName).forEach {
|
||||
it.inputStream().use { input ->
|
||||
session.openWrite("${sharedLibPkgName.ifBlank { packageName }}_${System.currentTimeMillis()}", 0, -1).use { output ->
|
||||
session.openWrite(sharedLibPkgName.ifBlank { packageName }, 0, it.length()).use { output ->
|
||||
input.copyTo(output)
|
||||
session.fsync(output)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user