version:2.3
fix:修复锁屏密码问题 update:
This commit is contained in:
@@ -3020,18 +3020,18 @@ public class NetInterfaceManager {
|
||||
}
|
||||
}
|
||||
|
||||
private void getLockScreenPwd(BehaviorSubject<ActivityEvent> lifecycle, CompleteCallback callback) {
|
||||
public void getLockScreenPwd(BehaviorSubject<ActivityEvent> lifecycle, CompleteCallback callback) {
|
||||
getLockScreenPwdObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||
.subscribe(getLockScreenPwdObserver(callback));
|
||||
}
|
||||
|
||||
private void getLockScreenPwd(CompleteCallback callback) {
|
||||
public void getLockScreenPwd(CompleteCallback callback) {
|
||||
getLockScreenPwdObservable()
|
||||
.subscribe(getLockScreenPwdObserver(callback));
|
||||
}
|
||||
|
||||
private void getLockScreenPwd() {
|
||||
public void getLockScreenPwd() {
|
||||
getLockScreenPwdObservable()
|
||||
.subscribe(getLockScreenPwdObserver(null));
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
|
||||
public static final String ACTION_LOCK = "LockScreenReceiver_lockscreen";
|
||||
public static final String ACTION_UNLOCK = "LockScreenReceiver_unlockscreen";
|
||||
public static final String ACTION_UPDATE = "TimeChangedReceiver_update";
|
||||
private static final String DEFAULT_PASSWORD = "0000";
|
||||
private WindowManager windowManager;
|
||||
private View topView;
|
||||
private boolean screenlocked = false;
|
||||
@@ -324,32 +325,15 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
|
||||
}
|
||||
Log.e(TAG, "inputComplete: " + content);
|
||||
String password = (String) SPUtils.get(ManagerService.this, UrlAddress.LOCK_SCREEN_PWD, "");
|
||||
if ((!TextUtils.isEmpty(content) && !TextUtils.isEmpty(password) && password.equals(content)) || "0000".equals(content)) {
|
||||
hideFloatingWindow();
|
||||
SPUtils.put(ManagerService.this, ManagerService.LOCK_STATE, 0);
|
||||
NetInterfaceManager.getInstance().getUpdateLockScreenObservable()
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse baseResponse) {
|
||||
Log.e("getUpdateLockScreenObservable", "onNext: " + baseResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if ((!TextUtils.isEmpty(content) && !TextUtils.isEmpty(password))) {
|
||||
if (password.equals(content)) {
|
||||
hide();
|
||||
}else {
|
||||
tv_hint.setText("密码错误");
|
||||
}
|
||||
} else if (DEFAULT_PASSWORD.equals(content)){
|
||||
hide();
|
||||
} else{
|
||||
// ToastUtil.show("密码错误");
|
||||
tv_hint.setText("密码错误");
|
||||
}
|
||||
@@ -358,6 +342,33 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
|
||||
|
||||
}
|
||||
|
||||
private void hide() {
|
||||
hideFloatingWindow();
|
||||
SPUtils.put(ManagerService.this, ManagerService.LOCK_STATE, 0);
|
||||
NetInterfaceManager.getInstance().getUpdateLockScreenObservable()
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse baseResponse) {
|
||||
Log.e("getUpdateLockScreenObservable", "onNext: " + baseResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void add(VerificationCodeView codeView, String text) {
|
||||
Log.e(TAG, "add: text = " + text);
|
||||
String oldText = codeView.getEditText().getText().toString();
|
||||
|
||||
@@ -15,6 +15,7 @@ public class MainSContact {
|
||||
void checkFXYUpdateFinish();
|
||||
void getAppAndWhiteFinish();
|
||||
void setOverallApp();
|
||||
void setLockScreenPwd();
|
||||
void setAppInside();
|
||||
void setForceInstall();
|
||||
void setSystemSettings();
|
||||
@@ -26,7 +27,6 @@ public class MainSContact {
|
||||
void setSnTimeControl();
|
||||
void setMyAppList();
|
||||
void setScreenLock();
|
||||
void setLockScreenPwd();
|
||||
}
|
||||
|
||||
interface Presenter extends BasePresenter<MainView> {
|
||||
@@ -40,7 +40,8 @@ public class MainSContact {
|
||||
void checkFXYUpdate();
|
||||
/*获取所有全局更新*/
|
||||
void getOverallApp();
|
||||
|
||||
//获取锁屏密码
|
||||
void getLockScreenPwd();
|
||||
|
||||
/*获取上传或下载的*/
|
||||
//获取设备信息
|
||||
@@ -73,7 +74,6 @@ public class MainSContact {
|
||||
void getMyAppList();
|
||||
//获取锁屏管控
|
||||
void getScreenLock();
|
||||
//获取锁屏密码
|
||||
void getLockScreenPwd();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,6 +143,15 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getLockScreenPwd() {
|
||||
NetInterfaceManager.getInstance().getLockScreenPwd(true, lifecycle, new NetInterfaceManager.CompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setLockScreenPwd();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSnInfo() {
|
||||
@@ -557,13 +566,5 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getLockScreenPwd() {
|
||||
NetInterfaceManager.getInstance().getLockScreenPwd(true, lifecycle, new NetInterfaceManager.CompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setLockScreenPwd();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -563,7 +563,12 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
|
||||
@Override
|
||||
public void setOverallApp() {
|
||||
Log.e(TAG, "setOverallApp: finish");
|
||||
mPresenter.getLockScreenPwd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLockScreenPwd() {
|
||||
Log.e(TAG, "setLockScreenPwd: finish");
|
||||
}
|
||||
|
||||
|
||||
@@ -613,15 +618,9 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
|
||||
@Override
|
||||
public void setScreenLock() {
|
||||
mPresenter.getLockScreenPwd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLockScreenPwd() {
|
||||
Log.e(TAG, "setLockScreenPwd: ");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setForceInstall() {
|
||||
mPresenter.getAppInside();
|
||||
|
||||
@@ -1259,6 +1259,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
intent.setAction(ManagerService.ACTION_UNLOCK);
|
||||
}
|
||||
context.sendBroadcast(intent);
|
||||
NetInterfaceManager.getInstance().getLockScreenPwd();
|
||||
}
|
||||
|
||||
private static Observable<Integer> getScreenshot(Context context, String filePath) {
|
||||
|
||||
Reference in New Issue
Block a user