Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0926f198 authored by Hall Liu's avatar Hall Liu Committed by Android (Google) Code Review
Browse files

Merge "Add missing null check in HomeVisibilityListener"

parents 3274f73e fc490ab2
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.app;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.content.ComponentName;
import android.content.Context;
import android.os.Binder;

@@ -101,12 +102,11 @@ public abstract class HomeVisibilityListener {
        }

        // We can assume that the screen is idle if the home application is in the foreground.
        String defaultHomePackage = mContext.getPackageManager()
                .getHomeActivities(new ArrayList<>()).getPackageName();
        if (Objects.equals(top, defaultHomePackage)) {
            return true;
        }
        ComponentName defaultHomeComponent = mContext.getPackageManager()
                .getHomeActivities(new ArrayList<>());
        if (defaultHomeComponent == null) return false;

        return false;
        String defaultHomePackage = defaultHomeComponent.getPackageName();
        return Objects.equals(top, defaultHomePackage);
    }
}