/** * Store the access permissions to preferences cache * * @param permissions */ public static void setAccessPermissions(AccessPermissions permissions) { getLimitsSharedPreferences() .edit() .putString( CommonUtils.getStringResource(R.string.setting_account_access_permissions), permissions == null ? null : permissions.toJsonString()) .commit(); }
/** * Get the cached access permissions information * * @return * @throws JSONException */ public static AccessPermissions getAccessPermissions() throws JSONException { String jsonString = getLimitsSharedPreferences() .getString( CommonUtils.getStringResource(R.string.setting_account_access_permissions), ""); AccessPermissions result = null; if (!TextUtils.isEmpty(jsonString)) { result = AccessPermissions.fromJson(new JSONObject(jsonString)); } return result; }