Skip to content

Commit

Permalink
更新V1.3.10
Browse files Browse the repository at this point in the history
- 修复背光控制问题
- 修复锁屏时间恢复问题
  • Loading branch information
mingzhixian committed Jan 23, 2024
1 parent 95cce47 commit 1719ad4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions easycontrol/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "top.saymzx.easycontrol.app"
minSdk 21
targetSdk 34
versionCode 10308
versionName "1.3.8"
versionCode 10310
versionName "1.3.10"
ndk {
abiFilters "arm64-v8a", "armeabi-v7a", "x86", "x86_64"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.os.Bundle;
import android.text.InputType;
import android.util.Pair;
import android.view.Display;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Toast;
Expand Down Expand Up @@ -100,11 +101,11 @@ private void setButtonListener() {
fullActivity.buttonFullExit.setOnClickListener(v -> clientView.changeToSmall());
fullActivity.buttonClose.setOnClickListener(v -> clientView.onClose.run());
fullActivity.buttonLight.setOnClickListener(v -> {
clientView.controlPacket.sendLightEvent(1);
clientView.controlPacket.sendLightEvent(Display.STATE_ON);
changeBarView();
});
fullActivity.buttonLightOff.setOnClickListener(v -> {
clientView.controlPacket.sendLightEvent(0);
clientView.controlPacket.sendLightEvent(Display.STATE_UNKNOWN);
changeBarView();
});
fullActivity.buttonPower.setOnClickListener(v -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.os.Build;
import android.text.InputType;
import android.util.Pair;
import android.view.Display;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -164,11 +165,11 @@ private void setButtonListener(ControlPacket controlPacket) {
smallView.buttonFull.setOnClickListener(v -> clientView.changeToFull());
smallView.buttonClose.setOnClickListener(v -> clientView.onClose.run());
smallView.buttonLight.setOnClickListener(v -> {
controlPacket.sendLightEvent(1);
controlPacket.sendLightEvent(Display.STATE_ON);
changeBarView();
});
smallView.buttonLightOff.setOnClickListener(v -> {
controlPacket.sendLightEvent(0);
controlPacket.sendLightEvent(Display.STATE_UNKNOWN);
changeBarView();
});
smallView.buttonPower.setOnClickListener(v -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public static void changeScreenPowerMode(int mode) {
}
} else {
IBinder d = SurfaceControl.getBuiltInDisplay();
if (d == null) SurfaceControl.setDisplayPowerMode(d, mode);
if (d != null) SurfaceControl.setDisplayPowerMode(d, mode);
}
}

Expand Down Expand Up @@ -230,7 +230,10 @@ private static void setKeepScreenLight() {
String output = execReadOutput("settings get system screen_off_timeout");
// 使用正则表达式匹配数字
Matcher matcher = Pattern.compile("\\d+").matcher(output);
if (matcher.find() && Integer.parseInt(matcher.group()) > 20) oldScreenOffTimeout = Integer.parseInt(matcher.group());
if (matcher.find()) {
int timeout = Integer.parseInt(matcher.group());
if (timeout >= 20 && timeout <= 60 * 30) oldScreenOffTimeout = timeout;
}
execReadOutput("settings put system screen_off_timeout 600000000");
} catch (Exception ignored) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static IBinder getBuiltInDisplay() {
try {
if (getBuiltInDisplayMethod == null) getBuiltInDisplayMethod = CLASS.getMethod("getBuiltInDisplay", int.class);
return (IBinder) getBuiltInDisplayMethod.invoke(null, 0);
} catch (Exception ignroed) {
} catch (Exception ignored) {
return null;
}
}
Expand Down

0 comments on commit 1719ad4

Please sign in to comment.