PreferenceUtils.java 5.84 KB
package com.arellomobile.android.push.utils;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import com.arellomobile.android.push.preference.SoundType;
import com.arellomobile.android.push.preference.VibrateType;

public class PreferenceUtils
{
  public static String getApplicationId(Context paramContext)
  {
    return paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).getString("dm_pwapp", "");
  }
  
  public static String getBaseUrl(Context paramContext)
  {
    return paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).getString("pw_base_url", "");
  }
  
  public static boolean getEnableLED(Context paramContext)
  {
    return paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).getBoolean("dm_ledon", false);
  }
  
  public static boolean getForceRegister(Context paramContext)
  {
    return paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).getBoolean("pw_forceregister", false);
  }
  
  public static long getLastRegistration(Context paramContext)
  {
    return paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).getLong("last_registration_change", 0L);
  }
  
  public static boolean getLightScreenOnNotification(Context paramContext)
  {
    return paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).getBoolean("dm_lightson", false);
  }
  
  public static int getMessageId(Context paramContext)
  {
    return paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).getInt("dm_messageid", 1001);
  }
  
  public static boolean getMultiMode(Context paramContext)
  {
    return paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).getBoolean("dm_multimode", false);
  }
  
  public static String getProjectId(Context paramContext)
  {
    return paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).getString("dm_sender_id", "");
  }
  
  public static SoundType getSoundType(Context paramContext)
  {
    return SoundType.fromInt(Integer.valueOf(paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).getInt("dm_soundtype", 0)).intValue());
  }
  
  public static VibrateType getVibrateType(Context paramContext)
  {
    return VibrateType.fromInt(Integer.valueOf(paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).getInt("dm_vibratetype", 0)).intValue());
  }
  
  public static void resetLastRegistration(Context paramContext)
  {
    paramContext = paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).edit();
    paramContext.remove("last_registration_change");
    paramContext.commit();
  }
  
  public static void setApplicationId(Context paramContext, String paramString)
  {
    paramContext = paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).edit();
    paramContext.putString("dm_pwapp", paramString);
    paramContext.commit();
  }
  
  public static void setBaseUrl(Context paramContext, String paramString)
  {
    paramContext = paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).edit();
    paramContext.putString("pw_base_url", paramString);
    paramContext.commit();
  }
  
  public static void setEnableLED(Context paramContext, boolean paramBoolean)
  {
    paramContext = paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).edit();
    paramContext.putBoolean("dm_ledon", paramBoolean);
    paramContext.commit();
  }
  
  public static void setForceRegister(Context paramContext, boolean paramBoolean)
  {
    paramContext = paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).edit();
    paramContext.putBoolean("pw_forceregister", paramBoolean);
    paramContext.commit();
  }
  
  public static void setLastRegistration(Context paramContext, long paramLong)
  {
    paramContext = paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).edit();
    paramContext.putLong("last_registration_change", paramLong);
    paramContext.commit();
  }
  
  public static void setLightScreenOnNotification(Context paramContext, boolean paramBoolean)
  {
    paramContext = paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).edit();
    paramContext.putBoolean("dm_lightson", paramBoolean);
    paramContext.commit();
  }
  
  public static void setMessageId(Context paramContext, int paramInt)
  {
    paramContext = paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).edit();
    paramContext.putInt("dm_messageid", paramInt);
    paramContext.commit();
  }
  
  public static void setMultiMode(Context paramContext, boolean paramBoolean)
  {
    paramContext = paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).edit();
    paramContext.putBoolean("dm_multimode", paramBoolean);
    paramContext.commit();
  }
  
  public static void setProjectId(Context paramContext, String paramString)
  {
    paramContext = paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).edit();
    paramContext.putString("dm_sender_id", paramString);
    paramContext.commit();
  }
  
  public static void setSoundType(Context paramContext, SoundType paramSoundType)
  {
    paramContext = paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).edit();
    paramContext.putInt("dm_soundtype", paramSoundType.getValue());
    paramContext.commit();
  }
  
  public static void setVibrateType(Context paramContext, VibrateType paramVibrateType)
  {
    paramContext = paramContext.getSharedPreferences("com.pushwoosh.pushnotifications", 0).edit();
    paramContext.putInt("dm_vibratetype", paramVibrateType.getValue());
    paramContext.commit();
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/com/arellomobile/android/push/utils/PreferenceUtils.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */