mirror of
https://github.com/Benjamin-Wiegand/Flywheel.git
synced 2026-09-12 18:42:33 -07:00
fix: catch errors while starting screen wake activity
This commit is contained in:
+13
-9
@@ -187,15 +187,19 @@ public class ProjectionService implements InputEventConverter.ConvertedInputEven
|
||||
private void startScreenWakeActivity() {
|
||||
if (!settingsManager.isKeepScreenAwakeEnabled()) return;
|
||||
Log.i(TAG, "starting screen wake activity");
|
||||
context.startActivity(
|
||||
new Intent(context, ScreenWakeActivity.class)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS),
|
||||
ActivityOptions.makeBasic()
|
||||
.setLaunchDisplayId(Display.DEFAULT_DISPLAY)
|
||||
.toBundle()
|
||||
);
|
||||
screenWakeActivityStarted = true;
|
||||
try {
|
||||
context.startActivity(
|
||||
new Intent(context, ScreenWakeActivity.class)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS),
|
||||
ActivityOptions.makeBasic()
|
||||
.setLaunchDisplayId(Display.DEFAULT_DISPLAY)
|
||||
.toBundle()
|
||||
);
|
||||
screenWakeActivityStarted = true;
|
||||
} catch (Throwable t) {
|
||||
Log.wtf(TAG, "failed to launch screen wake activity", t);
|
||||
}
|
||||
}
|
||||
|
||||
private void stopScreenWakeActivity() {
|
||||
|
||||
Reference in New Issue
Block a user