Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
courville committed Dec 19, 2024
1 parent 8635f21 commit 45c9ae2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/com/archos/mediaprovider/video/VideoProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import android.os.RemoteException;

import androidx.lifecycle.DefaultLifecycleObserver;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.ProcessLifecycleOwner;
import androidx.preference.PreferenceManager;
Expand Down Expand Up @@ -1389,9 +1390,10 @@ public void run(){
}

protected void handleForeGround(boolean foreground) {
log.debug("handleForeGround: foreground=" + foreground);
final Context context = getContext();
if (context == null) {
log.error("handleForeGround: context is null");
if (context == null || ! ProcessLifecycleOwner.get().getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
log.error("handleForeGround: context is null or not foreground, return");
return;
}
if (foreground) {
Expand Down

0 comments on commit 45c9ae2

Please sign in to comment.