feat(platform): 优化设备适配与抖动检测逻辑
- 新增DX11平台强制安装应用白名单 - 优化加速度传感器选择策略,优先使用TYPE_ACCELEROMETER - 分离普通加速度计与线性加速度计检测算法,调整方差阈值参数 - 增加默认输入法和默认浏览器设置广播 - 扩展USB广播兼容DX11平台 - 移除已废弃的ActivityController和重复代码 - 统一强制安装应用设置逻辑
This commit is contained in:
@@ -1053,13 +1053,13 @@ public class PushManager {
|
||||
|
||||
public void doscreenshot(final long time) {
|
||||
Observable.create(new ObservableOnSubscribe<Integer>() {
|
||||
@Override
|
||||
public void subscribe(ObservableEmitter<Integer> e) throws Exception {
|
||||
String filepath = mContext.getExternalFilesDir("db").getAbsolutePath();
|
||||
int n = CmdUtil.execute("screencap -p " + filepath + File.separator + time + ".db").code;
|
||||
e.onNext(n);
|
||||
}
|
||||
}).subscribeOn(Schedulers.io())
|
||||
@Override
|
||||
public void subscribe(ObservableEmitter<Integer> e) throws Exception {
|
||||
String filepath = mContext.getExternalFilesDir("db").getAbsolutePath();
|
||||
int n = CmdUtil.execute("screencap -p " + filepath + File.separator + time + ".db").code;
|
||||
e.onNext(n);
|
||||
}
|
||||
}).subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<Integer>() {
|
||||
@Override
|
||||
@@ -1210,6 +1210,25 @@ public class PushManager {
|
||||
mContext.startActivity(intent);
|
||||
|
||||
}
|
||||
JsonElement keyboardElement = jsonObject.get("default_IME");
|
||||
if (keyboardElement.isJsonNull() || TextUtils.isEmpty(keyboardElement.getAsString())) {
|
||||
Intent intent = new Intent("setDefaultInputMethod");
|
||||
intent.putExtra("package", "com.android.inputmethod.latin");
|
||||
intent.setPackage("com.android.settings");
|
||||
mContext.sendBroadcast(intent);
|
||||
} else {
|
||||
String default_IME = jsonObject.get("default_IME").getAsString();
|
||||
Intent intent = new Intent("setDefaultInputMethod");
|
||||
intent.putExtra("package", default_IME);
|
||||
intent.setPackage("com.android.settings");
|
||||
mContext.sendBroadcast(intent);
|
||||
}
|
||||
|
||||
String default_browser = jsonObject.get("default_browser").getAsString();
|
||||
Intent intent = new Intent("setDefaultBrowser");
|
||||
intent.putExtra("package", default_browser);
|
||||
intent.setPackage("com.android.settings");
|
||||
mContext.sendBroadcast(intent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user