diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java index ad54530d5..2d4b0d867 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java @@ -2512,6 +2512,11 @@ public class GamesListDelegate extends ListDelegateBase return result; } + private boolean downloadDictUpgrade( Intent intent ) + { + return UpdateCheckReceiver.downloadPerNotification( m_activity, intent ); + } + private boolean startNewNetGame( NetLaunchInfo nli ) { boolean handled = false; @@ -2975,6 +2980,7 @@ public class GamesListDelegate extends ListDelegateBase boolean handled = startFirstHasDict( intent ) || startWithInvitee( intent ) || postWordlistURL( intent ) + || downloadDictUpgrade( intent ) || loadConfig( intent ) || startNewNetGame( intent ) || startHasGameID( intent ) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java index 01b346781..1ec40039e 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java @@ -1,6 +1,6 @@ /* -*- compile-command: "find-and-gradle.sh inXw4dDeb"; -*- */ /* - * Copyright 2012 by Eric House (xwords@eehouse.org). All rights + * Copyright 2012 - 2022 by Eric House (xwords@eehouse.org). All rights * reserved. * * This program is free software; you can redistribute it and/or @@ -30,6 +30,7 @@ import android.content.pm.PackageManager; import android.net.Uri; import android.os.AsyncTask; import android.os.SystemClock; +import android.text.TextUtils; import java.io.File; import java.util.List; @@ -413,6 +414,19 @@ public class UpdateCheckReceiver extends BroadcastReceiver { body, url.hashCode() ); } + static boolean downloadPerNotification( Context context, Intent intent ) + { + String dictUri = intent.getStringExtra( NEW_DICT_URL ); + String name = intent.getStringExtra( NEW_DICT_NAME ); + boolean handled = !TextUtils.isEmpty( dictUri ) + && !TextUtils.isEmpty( name ); + if ( handled ) { + Uri uri = Uri.parse( dictUri ); + DwnldDelegate.downloadDictInBack( context, uri, name, null ); + } + return handled; + } + static boolean postedForDictDownload( Context context, final Uri uri, DwnldDelegate.DownloadFinishedListener dfl ) {