version:1.8
fix:应用使用记录 add:
This commit is contained in:
@@ -5,28 +5,15 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.aoleyun.os.base.MyApplication;
|
||||
import com.aoleyun.os.TTUtils.APKUtils;
|
||||
import com.aoleyun.os.network.AppPasswdBean;
|
||||
import com.aoleyun.os.network.BaseResponse;
|
||||
import com.aoleyun.os.network.HTTPInterface;
|
||||
import com.aoleyun.os.network.NetWorkManager;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import cn.jpush.android.api.JPushInterface;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
/**
|
||||
* 自定义接收器
|
||||
@@ -147,7 +134,7 @@ public class MyReceiver extends BroadcastReceiver {
|
||||
|
||||
switch (message) {
|
||||
case SEND_RUNNING_APP:
|
||||
sendRunningApp(context);
|
||||
HTTPInterface.SendRunningApp(context);
|
||||
break;
|
||||
case UPDATE_APP_LOCK:
|
||||
HTTPInterface.getAppPasswd();
|
||||
@@ -159,35 +146,4 @@ public class MyReceiver extends BroadcastReceiver {
|
||||
|
||||
}
|
||||
|
||||
private void sendRunningApp(Context context) {
|
||||
String packageName = MyApplication.getInstance().getAppPackageName();
|
||||
long time = MyApplication.getInstance().getOnClickTime();
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("app_package", packageName);
|
||||
jsonObject.addProperty("version_name", APKUtils.getAPPVersionName(context, packageName));
|
||||
jsonObject.addProperty("start_time", time / 1000);
|
||||
String jsonString = jsonObject.toString();
|
||||
NetWorkManager.getInstance().getRunningAppObservable(jsonString)
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e(TAG, "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse baseResponse) {
|
||||
Log.e(TAG, "onSubscribe: " + baseResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e(TAG, "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e(TAG, "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user