don't offer backup/restore earlier than KitKat

I'm using ContentResolver now, and it shows up in KitKat
This commit is contained in:
Eric House 2022-06-08 09:59:36 -07:00
parent a620ae4afc
commit d73481ba9b
2 changed files with 8 additions and 19 deletions

View file

@ -2040,19 +2040,6 @@ public class DBUtils {
}
}
public static boolean gameDBExists( Context context )
{
String varName = getVariantDBName();
boolean exists = new File( Environment.getExternalStorageDirectory(),
varName ).exists();
if ( !exists ) {
// try the old one
exists = new File( Environment.getExternalStorageDirectory(),
DBHelper.getDBName() ).exists();
}
return exists;
}
public static void addToStudyList( Context context, String word,
String isoCode )
{

View file

@ -542,8 +542,6 @@ public class GamesListDelegate extends ListDelegateBase
} // class GameListAdapter
private static final int[] DEBUG_ITEMS = {
// R.id.games_menu_loaddb,
R.id.games_menu_storedb,
R.id.games_menu_writegit,
R.id.games_submenu_logs,
};
@ -1672,14 +1670,18 @@ public class GamesListDelegate extends ListDelegateBase
final boolean showDbg = BuildConfig.NON_RELEASE
|| XWPrefs.getDebugEnabled( m_activity );
showItemsIf( DEBUG_ITEMS, menu, nothingSelected && showDbg );
Utils.setItemVisible( menu, R.id.games_menu_loaddb,
nothingSelected &&
DBUtils.gameDBExists( m_activity ) );
showItemsIf( NOSEL_ITEMS, menu, nothingSelected );
showItemsIf( ONEGAME_ITEMS, menu, 1 == nGamesSelected );
showItemsIf( ONEGROUP_ITEMS, menu, 1 == nGroupsSelected );
final boolean showDataItems =
Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT
&& nothingSelected;
for ( int item : new int[] { R.id.games_menu_storedb,
R.id.games_menu_loaddb } ) {
Utils.setItemVisible( menu, item, showDataItems );
}
boolean enable = showDbg && nothingSelected;
Utils.setItemVisible( menu, R.id.games_menu_checkupdates, enable );