get dict info immediately after install

I want Custom to show up as soon as you install a BYOD wordlist.
This commit is contained in:
Eric House 2023-05-29 16:54:12 -07:00
parent e3f9e6f32b
commit 99b4af8e53
2 changed files with 14 additions and 1 deletions

View file

@ -185,6 +185,8 @@ public class DwnldDelegate extends ListDelegateBase {
m_appFile = saveToPrivate( is, name, this );
} else {
m_savedDict = saveDict( is, name, this );
// force a check so BYOD lists will show as custom
UpdateCheckReceiver.checkDictVersions( m_activity );
}
is.close();
} catch ( java.net.URISyntaxException use ) {

View file

@ -121,6 +121,17 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
}
public static void checkVersions( Context context, boolean fromUI )
{
checkVersions( context, fromUI, false );
}
public static void checkDictVersions( Context context )
{
checkVersions( context, false, true );
}
private static void checkVersions( Context context, boolean fromUI,
boolean dictsOnly )
{
JSONObject params = new JSONObject();
PackageManager pm = context.getPackageManager();
@ -134,7 +145,7 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
}
// App update
if ( BuildConfig.FOR_FDROID ) {
if ( BuildConfig.FOR_FDROID || dictsOnly ) {
// Do nothing; can't upgrade app
} else {
String installer = pm.getInstallerPackageName( packageName );