fix: hard key(home, menu, back) not working when app crashes
This commit is contained in:
@@ -9,7 +9,7 @@ ui.layout(
|
|||||||
);
|
);
|
||||||
|
|
||||||
//getBrightnessMode()返回亮度模式,1为自动亮度
|
//getBrightnessMode()返回亮度模式,1为自动亮度
|
||||||
ui.auto.setChecked(device.getBrightnessMode());
|
ui.auto.setChecked(device.getBrightnessMode() == 1);
|
||||||
ui.auto.setOnCheckedChangeListener(function(v, checked){
|
ui.auto.setOnCheckedChangeListener(function(v, checked){
|
||||||
device.setBrightnessMode(checked ? 1: 0);
|
device.setBrightnessMode(checked ? 1: 0);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import com.stardust.scriptdroid.App;
|
import com.stardust.scriptdroid.App;
|
||||||
import com.stardust.scriptdroid.R;
|
import com.stardust.scriptdroid.R;
|
||||||
|
import com.stardust.scriptdroid.accessibility.AccessibilityService;
|
||||||
import com.stardust.util.IntentUtil;
|
import com.stardust.util.IntentUtil;
|
||||||
|
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
@@ -40,7 +41,6 @@ public class CrashHandler implements UncaughtExceptionHandler {
|
|||||||
return;
|
return;
|
||||||
String msg = App.getApp().getString(R.string.sorry_for_crash) + ex.toString();
|
String msg = App.getApp().getString(R.string.sorry_for_crash) + ex.toString();
|
||||||
startErrorReportActivity(msg, throwableToString(ex));
|
startErrorReportActivity(msg, throwableToString(ex));
|
||||||
System.exit(0);
|
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
throwable.printStackTrace();
|
throwable.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user