Skip to content

Commit 79da4a8

Browse files
committed
Do not change visibility if screen is active.
1 parent 2d09250 commit 79da4a8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/android/BackgroundModeExt.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,17 @@ public void onReceive(Context context, Intent intent) {
116116
wfl.acquire();
117117
}
118118

119-
getApp().runOnUiThread(() -> {
119+
if(isDimmed()) {
120+
getApp().runOnUiThread(() -> {
120121
View view = webView.getEngine().getView();
121122
int visibility = view.getVisibility();
122123
Log.d("MlesAlarm", "Updating visibility");
123124
view.dispatchWindowVisibilityChanged(View.VISIBLE);
124125
view.dispatchWindowVisibilityChanged(visibility);
125-
});
126+
});
126127

127-
webView.loadUrl("javascript:sendEmptyJoin()");
128+
webView.loadUrl("javascript:sendEmptyJoin()");
129+
}
128130

129131
alarmMgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
130132

0 commit comments

Comments
 (0)