예제 #1
0
 /**
  * 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();
 }
예제 #2
0
 /**
  * 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;
 }