From: snickersun Date: Thu, 6 Aug 2020 09:27:59 +0000 (+0800) Subject: release V479 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=dcc0d99dd3557e36cb05539a24bc3cff3f7d574a;p=protocol_srv.git release V479 把 久坐和睡眠 改为共享数据 --- diff --git a/app/release/ICSer_V475_2008042116_release.apk b/app/release/ICSer_V479_2008061723_release.apk similarity index 79% rename from app/release/ICSer_V475_2008042116_release.apk rename to app/release/ICSer_V479_2008061723_release.apk index 912d710c..692cba2b 100644 Binary files a/app/release/ICSer_V475_2008042116_release.apk and b/app/release/ICSer_V479_2008061723_release.apk differ diff --git a/app/src/main/java/com/enqualcomm/support/Config.java b/app/src/main/java/com/enqualcomm/support/Config.java index f9fb9638..383bd688 100644 --- a/app/src/main/java/com/enqualcomm/support/Config.java +++ b/app/src/main/java/com/enqualcomm/support/Config.java @@ -536,12 +536,13 @@ public class Config { //久坐时间获取 public static int getKeepSitRangeInMinutes(Context context ){ - return SharPreferenceUtil.getPrefInt(context,Constants.SHAREKEY_SETTING_SIT_ALARM_RANGE_IN_MINUTES,0); + return SharPreferenceUtil.getPrefIntPublic(context,Constants.SHAREKEY_SETTING_SIT_ALARM_RANGE_IN_MINUTES,0); } //久坐时间设置 public static void setKeepSitRangeInMinutes(Context context, int RangeInMinutes){ - SharPreferenceUtil.setPrefInt(context,Constants.SHAREKEY_SETTING_SIT_ALARM_RANGE_IN_MINUTES,RangeInMinutes); + + SharPreferenceUtil.setPrefIntPublic(context,Constants.SHAREKEY_SETTING_SIT_ALARM_RANGE_IN_MINUTES,RangeInMinutes); } public static void setSleepDate(Context context,String dateyyyyMMddHHmmss){ @@ -550,7 +551,7 @@ public class Config { public static void setSleepScore(Context context,int score){ - SharPreferenceUtil.setPrefInt(context,Constants.SHAREKEY_SETTING_SLEEP_SCORE,score); + SharPreferenceUtil.setPrefIntPublic(context,Constants.SHAREKEY_SETTING_SLEEP_SCORE,score); } /** diff --git a/app/src/main/java/com/enqualcomm/support/MainActivity.java b/app/src/main/java/com/enqualcomm/support/MainActivity.java index 115bf1a2..ff7cfad0 100644 --- a/app/src/main/java/com/enqualcomm/support/MainActivity.java +++ b/app/src/main/java/com/enqualcomm/support/MainActivity.java @@ -11,6 +11,7 @@ import android.os.Message; import android.os.StatFs; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.TextView; @@ -18,6 +19,7 @@ import android.widget.TextView; import com.enqualcomm.support.utils.DeviceInfoUtil; import com.enqualcomm.support.utils.ICLogger; import com.enqualcomm.support.utils.ImageUtil; +import com.enqualcomm.support.utils.SharPreferenceUtil; import com.enqualcomm.support.utils.TimeUtil; import com.enqualcomm.support.utils.Util; @@ -82,7 +84,7 @@ public class MainActivity extends AppCompatActivity { } }); - + // tesetSharedKey(); // SimSignalUtil.send_at_to_onoff_simcard(CoreService.getInstance().runtime)); @@ -232,4 +234,14 @@ public class MainActivity extends AppCompatActivity { } }; + + public void tesetSharedKey(){ + Config.setSleepScore(this,344); + Config.setSleepDate(this,TimeUtil.getSystemTime3()); + Config.setKeepSitRangeInMinutes(this,3); + ICLogger.d("SHAREKEY_SETTING_SLEEP_SCORE_DATE "+ SharPreferenceUtil.getPrefStringPublic(this,Constants.SHAREKEY_SETTING_SLEEP_SCORE_DATE,"")); + ICLogger.d("SHAREKEY_SETTING_SLEEP_SCORE "+ SharPreferenceUtil.getPrefIntPublic(this,Constants.SHAREKEY_SETTING_SLEEP_SCORE,0)); + ICLogger.d("SHAREKEY_SETTING_SIT_ALARM_RANGE_IN_MINUTES "+ SharPreferenceUtil.getPrefIntPublic(this,Constants.SHAREKEY_SETTING_SIT_ALARM_RANGE_IN_MINUTES,0)); + + } } diff --git a/app/src/main/java/com/enqualcomm/support/utils/SharPreferenceUtil.java b/app/src/main/java/com/enqualcomm/support/utils/SharPreferenceUtil.java index 0babe229..93f4f20b 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/SharPreferenceUtil.java +++ b/app/src/main/java/com/enqualcomm/support/utils/SharPreferenceUtil.java @@ -65,5 +65,12 @@ public class SharPreferenceUtil { SharedPreferences sp=context.getSharedPreferences("icprotocolconfig",Context.MODE_WORLD_WRITEABLE); sp.edit().putString(key, value).commit(); } - + public static void setPrefIntPublic(Context context, String key, int value) { + SharedPreferences sp=context.getSharedPreferences("icprotocolconfig",Context.MODE_WORLD_WRITEABLE); + sp.edit().putInt(key, value).commit(); + } + public static int getPrefIntPublic(Context context, String key, int value) { + SharedPreferences sp=context.getSharedPreferences("icprotocolconfig",Context.MODE_WORLD_READABLE); + return sp.getInt(key, value); + } } diff --git a/app/version_code.properties b/app/version_code.properties index bb13cba4..c77a6fb0 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Thu Aug 06 09:43:31 CST 2020 -VERSION_CODE=477 +#Thu Aug 06 17:23:57 CST 2020 +VERSION_CODE=479