mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 02:10:44 +01:00
Update website build to use PackageInstaller.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2023 Signal Messenger, LLC
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package org.thoughtcrime.securesms.keyvalue
|
||||
|
||||
internal class ApkUpdateValues(store: KeyValueStore) : SignalStoreValues(store) {
|
||||
companion object {
|
||||
private const val DOWNLOAD_ID = "apk_update.download_id"
|
||||
private const val DIGEST = "apk_update.digest"
|
||||
private const val AUTO_UPDATE = "apk_update.auto_update"
|
||||
}
|
||||
|
||||
override fun onFirstEverAppLaunch() = Unit
|
||||
override fun getKeysToIncludeInBackup(): List<String> = emptyList()
|
||||
|
||||
val downloadId: Long by longValue(DOWNLOAD_ID, -2)
|
||||
val digest: ByteArray? get() = store.getBlob(DIGEST, null)
|
||||
val autoUpdate: Boolean by booleanValue(AUTO_UPDATE, true)
|
||||
|
||||
fun setDownloadAttributes(id: Long, digest: ByteArray?) {
|
||||
store
|
||||
.beginWrite()
|
||||
.putLong(DOWNLOAD_ID, id)
|
||||
.putBlob(DIGEST, digest)
|
||||
.commit()
|
||||
}
|
||||
|
||||
fun clearDownloadAttributes() {
|
||||
store
|
||||
.beginWrite()
|
||||
.putLong(DOWNLOAD_ID, -1)
|
||||
.putBlob(DIGEST, null)
|
||||
.commit()
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,7 @@ public final class SignalStore {
|
||||
private final NotificationProfileValues notificationProfileValues;
|
||||
private final ReleaseChannelValues releaseChannelValues;
|
||||
private final StoryValues storyValues;
|
||||
private final ApkUpdateValues apkUpdate;
|
||||
|
||||
private final PlainTextSharedPrefsDataStore plainTextValues;
|
||||
|
||||
@@ -87,6 +88,7 @@ public final class SignalStore {
|
||||
this.notificationProfileValues = new NotificationProfileValues(store);
|
||||
this.releaseChannelValues = new ReleaseChannelValues(store);
|
||||
this.storyValues = new StoryValues(store);
|
||||
this.apkUpdate = new ApkUpdateValues(store);
|
||||
this.plainTextValues = new PlainTextSharedPrefsDataStore(ApplicationDependencies.getApplication());
|
||||
}
|
||||
|
||||
@@ -264,6 +266,10 @@ public final class SignalStore {
|
||||
return getInstance().storyValues;
|
||||
}
|
||||
|
||||
public static @NonNull ApkUpdateValues apkUpdate() {
|
||||
return getInstance().apkUpdate;
|
||||
}
|
||||
|
||||
public static @NonNull GroupsV2AuthorizationSignalStoreCache groupsV2AciAuthorizationCache() {
|
||||
return GroupsV2AuthorizationSignalStoreCache.createAciCache(getStore());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user