1.6.0526 增加高通和G128T平台
This commit is contained in:
@@ -27,86 +27,6 @@ import io.reactivex.disposables.Disposable;
|
||||
public class HTTPInterface {
|
||||
private static final String TAG = HTTPInterface.class.getSimpleName();
|
||||
|
||||
public static void getAppPasswd() {
|
||||
NetInterfaceManager.getInstance().getAppPasswordObservable()
|
||||
.subscribe(new Observer<BaseResponse<List<AppPasswdBean>>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("getAppPasswd", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse<List<AppPasswdBean>> listBaseResponse) {
|
||||
Log.e("getAppPasswd", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
List<AppPasswdBean> beanList = listBaseResponse.data;
|
||||
String jsonString = JsonParser.parseString(new Gson().toJson(beanList)).getAsJsonArray().toString();
|
||||
MMKV.defaultMMKV().encode("ApplicationLock", jsonString);
|
||||
Log.e("getAppPasswd", "onNext: " + jsonString);
|
||||
} else {
|
||||
MMKV.defaultMMKV().encode("ApplicationLock", "");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("getAppPasswd", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getAppPasswd", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送正在运行的app信息
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public static void sendRunningApp(Context context) {
|
||||
String packageName = TimeUtils.getInstance().getAppPackageName();
|
||||
Log.e("SendRunningApp", "packageName: " + packageName);
|
||||
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);
|
||||
jsonObject.addProperty("app_name", ApkUtils.getAppNameByPackage(context, packageName));
|
||||
jsonObject.addProperty("status", 1);
|
||||
String jsonString = jsonObject.toString();
|
||||
NetInterfaceManager.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", "onNext: " + 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;
|
||||
// sequence++;
|
||||
// tagAliasBean.tags = set;
|
||||
// tagAliasBean.isAliasAction = false;
|
||||
// TagAliasOperatorHelper.getInstance().handleAction(context, sequence, tagAliasBean);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user