mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-21 23:27:39 +00:00
Merge pull request #2385 from keymanapp/android-cherrypick-2378
[Android] Fix a few CloudRepository issues
This commit is contained in:
commit
4e5d1fa2db
3 changed files with 11 additions and 4 deletions
|
|
@ -40,8 +40,7 @@ public class CloudDataJsonUtil {
|
|||
String aFont, String aOskFont)
|
||||
{
|
||||
HashMap<String, String> keyboardInfo = new HashMap<String, String>();
|
||||
if(aPackageId!=null)
|
||||
keyboardInfo.put(KMManager.KMKey_PackageID, aPackageId);
|
||||
keyboardInfo.put(KMManager.KMKey_PackageID, aPackageId);
|
||||
keyboardInfo.put(KMManager.KMKey_KeyboardID, aKeyboardId);
|
||||
keyboardInfo.put(KMManager.KMKey_LanguageID, aLanguageId);
|
||||
keyboardInfo.put(KMManager.KMKey_KeyboardName, aKeyboardName);
|
||||
|
|
@ -57,7 +56,9 @@ public class CloudDataJsonUtil {
|
|||
|
||||
public static List<Keyboard> processKeyboardJSON(JSONObject query, boolean fromKMP) {
|
||||
List<Keyboard> keyboardsList = new ArrayList<>();
|
||||
//keyboardModifiedDates = new HashMap<String, String>();
|
||||
if (query.length() == 0) {
|
||||
return keyboardsList;
|
||||
}
|
||||
|
||||
String isCustom = fromKMP ? "Y" : "N";
|
||||
|
||||
|
|
@ -75,13 +76,14 @@ public class CloudDataJsonUtil {
|
|||
int kbLength = langKeyboards.length();
|
||||
for (int j = 0; j < kbLength; j++) {
|
||||
JSONObject keyboardJSON = langKeyboards.getJSONObject(j);
|
||||
String pkgID = keyboardJSON.optString(KMManager.KMKey_PackageID, KMManager.KMDefault_UndefinedPackageID);
|
||||
String kbID = keyboardJSON.getString(KMManager.KMKey_ID);
|
||||
String kbName = keyboardJSON.getString(KMManager.KMKey_Name);
|
||||
String kbVersion = keyboardJSON.optString(KMManager.KMKey_KeyboardVersion, "1.0");
|
||||
String kbFont = keyboardJSON.optString(KMManager.KMKey_Font, "");
|
||||
|
||||
//String kbKey = String.format("%s_%s", langID, kbID);
|
||||
HashMap<String, String> hashMap = createKeyboardInfoMap(null,langID,langName,kbID,kbName,kbVersion,isCustom,kbFont,null);
|
||||
HashMap<String, String> hashMap = createKeyboardInfoMap(pkgID,langID,langName,kbID,kbName,kbVersion,isCustom,kbFont,null);
|
||||
|
||||
|
||||
// if (keyboardModifiedDates.get(kbID) == null) {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ public class JSONUtils {
|
|||
* Will need to swap kmp.json (keyboards : languages) to cloud order (languages : keyboards)
|
||||
*/
|
||||
public static JSONArray getLanguages() {
|
||||
if (resourceRoot == null) {
|
||||
return new JSONArray();
|
||||
}
|
||||
File[] packages = resourceRoot.listFiles();
|
||||
JSONArray languagesArray = new JSONArray();
|
||||
JSONParser parser = new JSONParser();
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
## 2019-11-27 12.0.4211 stable
|
||||
* Bug fix:
|
||||
* Fix crashes involving context manipulation of invalid context (#2377)
|
||||
* Fix Package ID so other languages from a keyboard .kmp package can be installed (#2378)
|
||||
* Fix crashes when accessing the Cloud for downloading keyboards (#2378)
|
||||
|
||||
## 2019-11-26 12.0.4210 stable
|
||||
* No change to Keyman for Android (updated Keyman Web Engine, #2322)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue