Skip to content

Commit 85ce2fb

Browse files
committed
Avoid extensive logging.
1 parent 2a9b4bf commit 85ce2fb

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/android/BackgroundModeExt.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ private class AlarmReceiver extends BroadcastReceiver {
104104

105105
@Override
106106
public void onReceive(Context context, Intent intent) {
107-
PowerManager pm = (PowerManager)context.getSystemService(POWER_SERVICE);
108-
WifiManager wm = (WifiManager)context.getSystemService(Context.WIFI_SERVICE);
109107

110108
timeout = TIMEOUT;
111109
if(isOnBg()) {
112110
if(++wakeCounter == WAKELIMIT) {
113-
Log.d("MlesAlarm", "Acquiring locks");
111+
PowerManager pm = (PowerManager)context.getSystemService(POWER_SERVICE);
112+
WifiManager wm = (WifiManager)context.getSystemService(Context.WIFI_SERVICE);
113+
114114
if(null == wakeLock) {
115115
wakeLock = pm.newWakeLock(
116116
PARTIAL_WAKE_LOCK, "backgroundmode:wakelock");
@@ -123,14 +123,11 @@ public void onReceive(Context context, Intent intent) {
123123

124124
getApp().runOnUiThread(() -> {
125125
View view = webView.getEngine().getView();
126-
Log.d("MlesAlarm", "Updating visibility " + View.VISIBLE);
127126
view.dispatchWindowVisibilityChanged(View.VISIBLE);
128127
});
129128

130-
Log.d("MlesAlarm", "Calling resync");
131129
webView.loadUrl("javascript:syncReconnect()");
132130

133-
Log.d("MlesAlarm", "Releasing acquired locks");
134131
wfl.release();
135132
wfl = null;
136133
wakeLock.release();
@@ -142,7 +139,6 @@ public void onReceive(Context context, Intent intent) {
142139
else if(1 == wakeCounter) {
143140
getApp().runOnUiThread(() -> {
144141
View view = webView.getEngine().getView();
145-
Log.d("MlesAlarm", "Updating visibility " + View.GONE);
146142
view.dispatchWindowVisibilityChanged(View.GONE);
147143
});
148144
}
@@ -153,7 +149,6 @@ else if(1 == wakeCounter) {
153149
Intent newIntent = new Intent(RECEIVER);
154150

155151
alarmIntent = PendingIntent.getBroadcast(context, 0, newIntent, 0);
156-
Log.d("MlesAlarm", "Setting timeout " + timeout);
157152
alarmMgr.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME_WAKEUP,
158153
SystemClock.elapsedRealtime() + timeout, alarmIntent);
159154

0 commit comments

Comments
 (0)