show toast if user tries to update, but Data/WiFi settings disallow it

This commit is contained in:
Hans-Christoph Steiner 2018-07-19 13:27:35 +02:00
parent ac7916298a
commit 8503a625b5
2 changed files with 5 additions and 0 deletions

View File

@ -123,6 +123,10 @@ public class UpdateService extends JobIntentService {
* @see JobIntentService#enqueueWork(Context, Class, int, Intent)
*/
private static void enqueueWork(Context context, @NonNull Intent intent) {
if (!Preferences.get().isOnDemandDownloadAllowed()) {
Toast.makeText(context, R.string.updates_disabled_by_settings, Toast.LENGTH_LONG).show();
}
enqueueWork(context, UpdateService.class, JOB_ID, intent);
}

View File

@ -129,6 +129,7 @@ This often occurs with apps installed via Google Play or other sources, if they
<item quantity="one">Download update for %1$d app.</item>
<item quantity="other">Download updates for %1$d apps.</item>
</plurals>
<string name="updates_disabled_by_settings">All updates disabled by Data/WiFi Settings</string>
<string name="ok">OK</string>