use of com.google.android.play.core.appupdate.AppUpdateManager in project alpha-wallet-android by AlphaWallet.
the class UpdateUtils method pushUpdateDialog.
public static void pushUpdateDialog(Activity context) {
AppUpdateManager appUpdateManager = AppUpdateManagerFactory.create(context);
Task<AppUpdateInfo> appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();
appUpdateInfoTask.addOnSuccessListener(appUpdateInfo -> {
if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE) {
appUpdateManager.startUpdateFlow(appUpdateInfo, context, AppUpdateOptions.newBuilder(AppUpdateType.FLEXIBLE).build());
}
});
}
use of com.google.android.play.core.appupdate.AppUpdateManager in project alpha-wallet-android by AlphaWallet.
the class UpdateUtils method checkForUpdates.
public static void checkForUpdates(Activity context, FragmentMessenger messenger) {
AppUpdateManager appUpdateManager = AppUpdateManagerFactory.create(context);
Task<AppUpdateInfo> appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();
appUpdateInfoTask.addOnSuccessListener(appUpdateInfo -> {
if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE) {
messenger.updateReady(appUpdateInfo.availableVersionCode());
}
});
}
use of com.google.android.play.core.appupdate.AppUpdateManager in project Ethernity-Wallet-Android by kris-krytech.
the class UpdateUtils method pushUpdateDialog.
public static void pushUpdateDialog(Activity context) {
AppUpdateManager appUpdateManager = AppUpdateManagerFactory.create(context);
Task<AppUpdateInfo> appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();
appUpdateInfoTask.addOnSuccessListener(appUpdateInfo -> {
if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE) {
appUpdateManager.startUpdateFlow(appUpdateInfo, context, AppUpdateOptions.newBuilder(AppUpdateType.FLEXIBLE).build());
}
});
}
use of com.google.android.play.core.appupdate.AppUpdateManager in project Ethernity-Wallet-Android by kris-krytech.
the class UpdateUtils method checkForUpdates.
public static void checkForUpdates(Activity context, FragmentMessenger messenger) {
AppUpdateManager appUpdateManager = AppUpdateManagerFactory.create(context);
Task<AppUpdateInfo> appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();
appUpdateInfoTask.addOnSuccessListener(appUpdateInfo -> {
if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE) {
messenger.updateReady(appUpdateInfo.availableVersionCode());
}
});
}
use of com.google.android.play.core.appupdate.AppUpdateManager in project play-core-samples by aospstudio.
the class MainActivityJava method initAppUpdateManager.
/* FLEXIBLE or IMMEDIATE */
private void initAppUpdateManager() {
AppUpdateManager appUpdateManager = AppUpdateManagerFactory.create(context);
appUpdateManager.getAppUpdateInfo().addOnSuccessListener(appUpdateInfo -> {
if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE && appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)) {
try {
appUpdateManager.startUpdateFlowForResult(appUpdateInfo, AppUpdateType.FLEXIBLE, this, 2000);
} catch (IntentSender.SendIntentException e) {
e.printStackTrace();
}
} else if (appUpdateInfo.updateAvailability() == UpdateAvailability.DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS && appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)) {
try {
appUpdateManager.startUpdateFlowForResult(appUpdateInfo, AppUpdateType.FLEXIBLE, this, 2000);
} catch (IntentSender.SendIntentException e) {
e.printStackTrace();
}
}
});
}
Aggregations