version:1.8
fix:应用使用记录 add:
This commit is contained in:
@@ -4,8 +4,10 @@ import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.aoleyun.os.TTUtils.APKUtils;
|
||||
import com.aoleyun.os.jpush.TagAliasOperatorHelper;
|
||||
import com.aoleyun.os.uiuiutils.JGYUtils;
|
||||
import com.aoleyun.os.uiuiutils.TimeUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
@@ -33,7 +35,7 @@ public class HTTPInterface {
|
||||
private static final String TAG = HTTPInterface.class.getSimpleName();
|
||||
|
||||
public static void getAppPasswd() {
|
||||
NetWorkManager.getInstance().getAppPasswordObservable()
|
||||
NetworkManager.getInstance().getAppPasswordObservable()
|
||||
.subscribe(new Observer<BaseResponse<List<AppPasswdBean>>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
@@ -66,7 +68,7 @@ public class HTTPInterface {
|
||||
}
|
||||
|
||||
synchronized public static void setJpushTags(final Context context) {
|
||||
NetWorkManager.getInstance()
|
||||
NetworkManager.getInstance()
|
||||
.getJpushTagsObservable()
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
@@ -115,6 +117,38 @@ public class HTTPInterface {
|
||||
});
|
||||
}
|
||||
|
||||
public static void SendRunningApp(Context context) {
|
||||
String packageName = TimeUtils.getInstance().getAppPackageName();
|
||||
long time = TimeUtils.getInstance().getStartTime();
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("app_package", packageName);
|
||||
jsonObject.addProperty("version_name", APKUtils.getAPPVersionName(context, packageName));
|
||||
jsonObject.addProperty("run_time", time / 1000);
|
||||
String jsonString = jsonObject.toString();
|
||||
NetworkManager.getInstance().getRunningAppObservable(jsonString)
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("SendRunningApp", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse baseResponse) {
|
||||
Log.e("SendRunningApp", "onSubscribe: " + baseResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("SendRunningApp", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("SendRunningApp", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void setTag(Context context, Set set) {
|
||||
TagAliasOperatorHelper.TagAliasBean tagAliasBean = new TagAliasOperatorHelper.TagAliasBean();
|
||||
tagAliasBean.action = ACTION_SET;
|
||||
|
||||
Reference in New Issue
Block a user