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