version:3.0.1_beta
update:2020.06.29 fix:修复在没网的时候anr add:
This commit is contained in:
@@ -15,8 +15,8 @@ android {
|
|||||||
minSdkVersion 20
|
minSdkVersion 20
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
|
|
||||||
versionCode 148
|
versionCode 140
|
||||||
versionName "3.0.5"//测试jiaoguanyi.cn
|
versionName "3.0.1"//测试jiaoguanyi.cn
|
||||||
// versionCode 1002
|
// versionCode 1002
|
||||||
// versionName "2.0.1.2"// 正式jiaoguanyi.com 双数正式 单数测试
|
// versionName "2.0.1.2"// 正式jiaoguanyi.com 双数正式 单数测试
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
@@ -133,7 +133,7 @@ dependencies {
|
|||||||
// implementation 'com.github.bumptech.glide:glide:4.0.0'
|
// implementation 'com.github.bumptech.glide:glide:4.0.0'
|
||||||
// annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'
|
// annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'
|
||||||
|
|
||||||
implementation 'com.alibaba:fastjson:1.2.18'
|
implementation 'com.alibaba:fastjson:1.2.70'
|
||||||
|
|
||||||
implementation 'com.lzy.net:okgo:2.1.4'
|
implementation 'com.lzy.net:okgo:2.1.4'
|
||||||
implementation 'com.lzy.net:okrx:0.1.2'
|
implementation 'com.lzy.net:okrx:0.1.2'
|
||||||
|
|||||||
@@ -206,9 +206,11 @@ public class MyApplication extends MultiDexApplication {
|
|||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
String action = intent.getAction();
|
String action = intent.getAction();
|
||||||
Log.e("fht", "receiver action:" + action);
|
Log.e("fht", "receiver action:" + action);
|
||||||
if (action.equals(Intent.ACTION_SCREEN_ON)
|
if (action.equals(Intent.ACTION_SCREEN_ON)) {
|
||||||
|| action.equals(Intent.ACTION_USER_PRESENT)
|
long time = System.currentTimeMillis();
|
||||||
) {
|
getLockState("2", String.valueOf(time));
|
||||||
|
} else if (action.equals(Intent.ACTION_USER_PRESENT)) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
time2 = System.currentTimeMillis();
|
time2 = System.currentTimeMillis();
|
||||||
if ((time2 - time1) > 60 * 1000) {
|
if ((time2 - time1) > 60 * 1000) {
|
||||||
//可能会多次触发,1分钟之内不执行
|
//可能会多次触发,1分钟之内不执行
|
||||||
@@ -217,17 +219,14 @@ public class MyApplication extends MultiDexApplication {
|
|||||||
startService(new Intent(context, StepService.class));
|
startService(new Intent(context, StepService.class));
|
||||||
startService(new Intent(context, GuardService.class));
|
startService(new Intent(context, GuardService.class));
|
||||||
time1 = time2;
|
time1 = time2;
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
long time = System.currentTimeMillis();
|
}
|
||||||
getLockState("2", String.valueOf(time));
|
|
||||||
|
|
||||||
} else if (action.equals(Intent.ACTION_SCREEN_OFF)) {
|
} else if (action.equals(Intent.ACTION_SCREEN_OFF)) {
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
getLockState("1", String.valueOf(time));
|
getLockState("1", String.valueOf(time));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getLockState(String status, String time) {
|
private void getLockState(String status, String time) {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class BootReceiver extends BroadcastReceiver {
|
|||||||
|| intent.getAction().equals("android.intent.action.ACTION_POWER_CONNECTED")
|
|| intent.getAction().equals("android.intent.action.ACTION_POWER_CONNECTED")
|
||||||
|| intent.getAction().equals("android.intent.action.DATE_CHANGED")
|
|| intent.getAction().equals("android.intent.action.DATE_CHANGED")
|
||||||
|| intent.getAction().equals("android.intent.action.TIME_TICK")
|
|| intent.getAction().equals("android.intent.action.TIME_TICK")
|
||||||
// || intent.getAction().equals("android.intent.action.USER_PRESENT")
|
|| intent.getAction().equals("android.intent.action.USER_PRESENT")
|
||||||
|| intent.getAction().equals("android.intent.action.SCREEN_ON")
|
|| intent.getAction().equals("android.intent.action.SCREEN_ON")
|
||||||
|| intent.getAction().equals("android.intent.action.SCREEN_OFF")
|
|| intent.getAction().equals("android.intent.action.SCREEN_OFF")
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -219,8 +219,8 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
com.alibaba.fastjson.JSONObject extra = JSON.parseObject(extras);
|
com.alibaba.fastjson.JSONObject extra = JSON.parseObject(extras);
|
||||||
String app_name=extra.getString("app_name");
|
String app_name = extra.getString("app_name");
|
||||||
String app_package=extra.getString("package");
|
String app_package = extra.getString("package");
|
||||||
String url = extra.getString("url");
|
String url = extra.getString("url");
|
||||||
int versionCode = extra.getInteger("version_code");
|
int versionCode = extra.getInteger("version_code");
|
||||||
|
|
||||||
@@ -398,8 +398,10 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
stringBuffer.deleteCharAt(stringBuffer.length() - 1);
|
stringBuffer.deleteCharAt(stringBuffer.length() - 1);
|
||||||
Settings.System.putString(this.mContext.getContentResolver(), "qch_tfmedia_filetypes", stringBuffer.toString());//影音管控
|
String s = Settings.System.getString(this.mContext.getContentResolver(), "qch_tfmedia_filetypes");//影音管控
|
||||||
Log.e("SystemSetting", "qch_tfmedia_filetypes---------" + stringBuffer.toString());
|
Log.e("SystemSetting", "qch_tfmedia_filetypes old" + s);
|
||||||
|
boolean b = Settings.System.putString(this.mContext.getContentResolver(), "qch_tfmedia_filetypes", stringBuffer.toString());//影音管控
|
||||||
|
Log.e("SystemSetting", "qch_tfmedia_filetypes---------" + b + ":" + stringBuffer.toString());
|
||||||
|
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
Log.e("SystemSetting", "qch_tfmedia_filetypes---------" + e.getMessage());
|
Log.e("SystemSetting", "qch_tfmedia_filetypes---------" + e.getMessage());
|
||||||
@@ -906,7 +908,6 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void settingLock(String s) {
|
public void settingLock(String s) {
|
||||||
if (TextUtils.isEmpty(s)) {
|
if (TextUtils.isEmpty(s)) {
|
||||||
Log.e("mjsheng", "settingLock extras is null");
|
Log.e("mjsheng", "settingLock extras is null");
|
||||||
|
|||||||
@@ -130,8 +130,8 @@ public class StepService extends Service {
|
|||||||
public void onClose(int code, String reason, boolean remote) {
|
public void onClose(int code, String reason, boolean remote) {
|
||||||
super.onClose(code, reason, remote);
|
super.onClose(code, reason, remote);
|
||||||
Log.i("JWebSocketClientService", "websocket连接关闭");
|
Log.i("JWebSocketClientService", "websocket连接关闭");
|
||||||
client = null;
|
// client.close();
|
||||||
initSocketClient();
|
// initSocketClient();
|
||||||
mHandler.postDelayed(heartBeatRunnable, HEART_BEAT_RATE);//开启心跳检测
|
mHandler.postDelayed(heartBeatRunnable, HEART_BEAT_RATE);//开启心跳检测
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -140,8 +140,8 @@ public class StepService extends Service {
|
|||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
super.onError(ex);
|
super.onError(ex);
|
||||||
Log.i("JWebSocketClientService", "websocket连接错误");
|
Log.i("JWebSocketClientService", "websocket连接错误");
|
||||||
client = null;
|
// client.close();
|
||||||
initSocketClient();
|
// initSocketClient();
|
||||||
mHandler.postDelayed(heartBeatRunnable, HEART_BEAT_RATE);//开启心跳检测
|
mHandler.postDelayed(heartBeatRunnable, HEART_BEAT_RATE);//开启心跳检测
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user