diff --git a/CHANGELOG.md b/CHANGELOG.md index 650bb4d..ad4b08e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ -# Latest version: [piLauncherNext_101.apk](https://github.com/Veticia/binaries/raw/main/releases/piLauncherNext_101.apk) +# Latest version: [piLauncherNext_102.apk](https://github.com/Veticia/binaries/raw/main/releases/piLauncherNext_102.apk) ## Changelog +### 1.0.2 +- hotfix: default group PSP not created on first launch + ### 1.0.1 - hotfix: nullPointerException crash on first run diff --git a/Launcher/App/build.gradle b/Launcher/App/build.gradle index 5bab4b6..19bb331 100644 --- a/Launcher/App/build.gradle +++ b/Launcher/App/build.gradle @@ -21,8 +21,8 @@ android { minSdkVersion 23 //noinspection ExpiredTargetSdkVersion targetSdkVersion 23 - versionCode 101 - versionName "1.0.1" + versionCode 102 + versionName "1.0.2" signingConfig signingConfigs.release } diff --git a/Launcher/App/src/main/java/com/veticia/piLauncherNext/SettingsProvider.java b/Launcher/App/src/main/java/com/veticia/piLauncherNext/SettingsProvider.java index 45a4a38..0004a30 100644 --- a/Launcher/App/src/main/java/com/veticia/piLauncherNext/SettingsProvider.java +++ b/Launcher/App/src/main/java/com/veticia/piLauncherNext/SettingsProvider.java @@ -55,7 +55,6 @@ public static synchronized SettingsProvider getInstance (Context context) } return SettingsProvider.instance; } - private boolean isPSPSupported = false; //storage private final SharedPreferences mPreferences; @@ -63,6 +62,7 @@ public static synchronized SettingsProvider getInstance (Context context) private Set mAppGroups = new HashSet<>(); private Set mSelectedGroups = new HashSet<>(); private Map mRecents = new HashMap<>(); + Set def = new HashSet<>(); private SettingsProvider(Context context) { mPreferences = PreferenceManager.getDefaultSharedPreferences(context); @@ -102,9 +102,6 @@ public ArrayList getInstalledApps(Context context, List if (isPlatformEnabled(KEY_PLATFORM_VR)) { List vrApps = new VRPlatform().getInstalledApps(context); for (ApplicationInfo app : vrApps) { - if (app.packageName.startsWith(MainActivity.EMULATOR_PACKAGE)) { - isPSPSupported = true; - } if (!mAppList.containsKey(app.packageName) && mAppGroups.contains(context.getString(R.string.default_apps_group))) { mAppList.put(app.packageName, context.getString(R.string.default_apps_group)); } @@ -123,18 +120,14 @@ public ArrayList getInstalledApps(Context context, List } if (isPlatformEnabled(KEY_PLATFORM_PSP)) { - if(isPSPSupported) { - // only add PSP apps if the platform is supported - List pspApps = new PSPPlatform().getInstalledApps(context); - for (ApplicationInfo app : pspApps) { - if (!mAppList.containsKey(app.packageName) && mAppGroups.contains("PSP")) { - mAppList.put(app.packageName, "PSP"); - } + // only add PSP apps if the platform is supported + List pspApps = new PSPPlatform().getInstalledApps(context); + for (ApplicationInfo app : pspApps) { + if (!mAppList.containsKey(app.packageName) && mAppGroups.contains("PSP")) { + mAppList.put(app.packageName, "PSP"); } - installedApplications.addAll(pspApps); } - }else{ - isPSPSupported = false; + installedApplications.addAll(pspApps); } // Save changes to app list @@ -259,14 +252,22 @@ private synchronized void readValues() { try { - Set def = new HashSet<>(); - def.add(context.getString(R.string.default_apps_group)); + String defAppsGroup = context.getString(R.string.default_apps_group); + if (!def.contains(defAppsGroup)) { + def.add(defAppsGroup); + } Set defClone = new HashSet<>(); - defClone.add(context.getString(R.string.default_apps_group)); + defClone.add(defAppsGroup); mSelectedGroups = mPreferences.getStringSet(KEY_SELECTED_GROUPS, defClone); - def.add(context.getString(R.string.default_tools_group)); - if (isPSPSupported) { - def.add("PSP"); + String defToolsGroup = context.getString(R.string.default_tools_group); + if (!def.contains(defToolsGroup)) { + def.add(defToolsGroup); + } + String defPSPgroup = "PSP"; + if (!def.contains(defPSPgroup)) { + if (new PSPPlatform().isSupported(context)) { + def.add(defPSPgroup); + } } mAppGroups = mPreferences.getStringSet(KEY_APP_GROUPS, def);