public long getLatestForegroundPackageUseTimeInMills() {
        int[] foregroundReasons = {
                android.content.pm.PackageManager.NOTIFY_PACKAGE_USE_ACTIVITY,
                PackageManager.NOTIFY_PACKAGE_USE_FOREGROUND_SERVICE
        };

        long latestUse = 0L;
        for (int reason : foregroundReasons) {
            latestUse = Math.max(latestUse, mLastPackageUsageTimeInMills[reason]);
        }
        return latestUse;
    }
Filtered set of {@link #getAllCodePaths()} that excludes
resource-only APKs.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/Package.java