core-android/src/main/java/com/uber/sdk/android/core/utils/AppProtocol.java
@NonNull
    public List<PackageInfo> getInstalledPackages(
            @NonNull Context context, @NonNull SupportedAppType supportedApp, int minimumVersion) {
        List<PackageInfo> packageInfos = new ArrayList<>();

        List<Pair<SupportedAppType, PackageInfo>> installedApps = getInstalledPackagesByApp(context, supportedApp);

        for (Pair<SupportedAppType, PackageInfo> installedApp : installedApps) {
            PackageInfo packageInfo = installedApp.second;
            if (packageInfo != null
                    && validateSignature(context, packageInfo.packageName)
                    && validateMinimumVersion(context, packageInfo, minimumVersion)) {
                packageInfos.add(packageInfo);
            }
        }
        return packageInfos;
    }
@NonNull
    public List<PackageInfo> getInstalledPackages(
            @NonNull Context context, @NonNull SupportedAppType supportedApp, int minimumVersion) {
        List<PackageInfo> packageInfos = new ArrayList<>();

        List<Pair<SupportedAppType, PackageInfo>> installedApps = getInstalledPackagesByApp(context, supportedApp);

        for (Pair<SupportedAppType, PackageInfo> installedApp : installedApps) {
            PackageInfo packageInfo = installedApp.second;
            if (packageInfo != null
                    && validateSignature(context, packageInfo.packageName)
                    && validateMinimumVersion(context, packageInfo, minimumVersion)) {
                packageInfos.add(packageInfo);
            }
        }
        return packageInfos;
    }
@ NonNull public List < PackageInfo > getInstalledPackages ( @ NonNull Context context , @ NonNull SupportedAppType supportedApp , int minimumVersion ) { List < PackageInfo > packageInfos = new ArrayList <> ( ) ; List < Pair < SupportedAppType , PackageInfo > > installedApps = getInstalledPackagesByApp ( context , supportedApp ) ; for ( Pair < SupportedAppType , PackageInfo > installedApp : installedApps ) { PackageInfo packageInfo = installedApp . second ; if ( packageInfo != null && validateSignature ( context , packageInfo . packageName ) && validateMinimumVersion ( context , packageInfo , minimumVersion ) ) { packageInfos . add ( packageInfo ) ; } } return packageInfos ; }
Find the installed and validated packages for a {@link SupportedAppType}.
<p>
This will validate the signature and minimum version of the installed package or exclude it from returned list.

@param context         A {@link Context}.
@param supportedApp   The {@link SupportedAppType}.
@param minimumVersion The minimum version of {@link SupportedAppType} that must be installed.
@return A list of {@link PackageInfo} which is installed and has been validated.
Find the installed and validated packages for a { @link SupportedAppType } . <p > This will validate the signature and minimum version of the installed package or exclude it from returned list .