Skip to content

Commit 73fd2ea

Browse files
alperozturk96backportbot[bot]
authored andcommitted
Fix dodgy bugs
Signed-off-by: alperozturk <[email protected]>
1 parent 728d33b commit 73fd2ea

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

app/src/main/java/com/owncloud/android/MainApp.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
import androidx.appcompat.app.AlertDialog;
113113
import androidx.appcompat.app.AppCompatDelegate;
114114
import androidx.core.util.Pair;
115+
import androidx.lifecycle.Lifecycle;
115116
import androidx.lifecycle.LifecycleEventObserver;
116117
import androidx.lifecycle.ProcessLifecycleOwner;
117118
import androidx.multidex.MultiDexApplication;
@@ -358,14 +359,11 @@ public void onCreate() {
358359
}
359360

360361
private final LifecycleEventObserver lifecycleEventObserver = ((lifecycleOwner, event) -> {
361-
switch (event) {
362-
case ON_START -> {
363-
Log_OC.d(TAG, "APP IN FOREGROUND");
364-
}
365-
case ON_STOP -> {
366-
passCodeManager.setCanAskPin(true);
367-
Log_OC.d(TAG, "APP IN BACKGROUND");
368-
}
362+
if (event == Lifecycle.Event.ON_START) {
363+
Log_OC.d(TAG, "APP IN FOREGROUND");
364+
} else if (event == Lifecycle.Event.ON_STOP) {
365+
passCodeManager.setCanAskPin(true);
366+
Log_OC.d(TAG, "APP IN BACKGROUND");
369367
}
370368
});
371369

0 commit comments

Comments
 (0)