Update website build to use PackageInstaller.

This commit is contained in:
Greyson Parrelli
2023-10-23 11:30:37 -07:00
committed by GitHub
parent d468d4c21b
commit 4b004f70ec
24 changed files with 759 additions and 458 deletions

View File

@@ -14,7 +14,7 @@ public final class PlayStoreUtil {
private PlayStoreUtil() {}
public static void openPlayStoreOrOurApkDownloadPage(@NonNull Context context) {
if (BuildConfig.PLAY_STORE_DISABLED) {
if (BuildConfig.MANAGES_APP_UPDATES) {
CommunicationActions.openBrowserLink(context, "https://signal.org/android/apk");
} else {
openPlayStore(context);

View File

@@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.util;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.AlarmManager;
import android.app.DownloadManager;
import android.app.KeyguardManager;
import android.app.NotificationManager;
import android.app.job.JobScheduler;
@@ -112,4 +113,8 @@ public class ServiceUtil {
public static BluetoothManager getBluetoothManager(@NotNull Context context) {
return ContextCompat.getSystemService(context, BluetoothManager.class);
}
public static DownloadManager getDownloadManager(@NonNull Context context) {
return ContextCompat.getSystemService(context, DownloadManager.class);
}
}

View File

@@ -83,8 +83,6 @@ public class TextSecurePreferences {
private static final String PROMPTED_OPTIMIZE_DOZE_PREF = "pref_prompted_optimize_doze";
private static final String DIRECTORY_FRESH_TIME_PREF = "pref_directory_refresh_time";
private static final String UPDATE_APK_REFRESH_TIME_PREF = "pref_update_apk_refresh_time";
private static final String UPDATE_APK_DOWNLOAD_ID = "pref_update_apk_download_id";
private static final String UPDATE_APK_DIGEST = "pref_update_apk_digest";
private static final String SIGNED_PREKEY_ROTATION_TIME_PREF = "pref_signed_pre_key_rotation_time";
private static final String IN_THREAD_NOTIFICATION_PREF = "pref_key_inthread_notifications";
@@ -624,22 +622,6 @@ public class TextSecurePreferences {
setLongPreference(context, UPDATE_APK_REFRESH_TIME_PREF, value);
}
public static void setUpdateApkDownloadId(Context context, long value) {
setLongPreference(context, UPDATE_APK_DOWNLOAD_ID, value);
}
public static long getUpdateApkDownloadId(Context context) {
return getLongPreference(context, UPDATE_APK_DOWNLOAD_ID, -1);
}
public static void setUpdateApkDigest(Context context, String value) {
setStringPreference(context, UPDATE_APK_DIGEST, value);
}
public static String getUpdateApkDigest(Context context) {
return getStringPreference(context, UPDATE_APK_DIGEST, null);
}
public static boolean isEnterImeKeyEnabled(Context context) {
return getBooleanPreference(context, ENTER_PRESENT_PREF, false);
}