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

Commit ab7caa87 authored by Anna Zhuravleva's avatar Anna Zhuravleva Committed by Android (Google) Code Review
Browse files

Merge "Add null check for InstallAppInfo" into main

parents 771cb584 28ee5dd4
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -71,6 +71,7 @@ import android.content.pm.IPackageInstallerCallback;
import android.content.pm.IPackageManager;
import android.content.pm.IPackageManager;
import android.content.pm.IShortcutChangeCallback;
import android.content.pm.IShortcutChangeCallback;
import android.content.pm.IncrementalStatesInfo;
import android.content.pm.IncrementalStatesInfo;
import android.content.pm.InstallSourceInfo;
import android.content.pm.LauncherActivityInfoInternal;
import android.content.pm.LauncherActivityInfoInternal;
import android.content.pm.LauncherApps;
import android.content.pm.LauncherApps;
import android.content.pm.LauncherApps.ShortcutQuery;
import android.content.pm.LauncherApps.ShortcutQuery;
@@ -1856,9 +1857,11 @@ public class LauncherAppsService extends SystemService {
        private String getInstallerPackage(@NonNull String packageName, int callingUserId) {
        private String getInstallerPackage(@NonNull String packageName, int callingUserId) {
            String installerPackageName = null;
            String installerPackageName = null;
            try {
            try {
                installerPackageName =
                InstallSourceInfo info = mIPM.getInstallSourceInfo(packageName, callingUserId);
                        mIPM.getInstallSourceInfo(packageName, callingUserId)
                if (info == null) {
                                .getInstallingPackageName();
                    return installerPackageName;
                }
                installerPackageName = info.getInstallingPackageName();
            } catch (RemoteException re) {
            } catch (RemoteException re) {
                Slog.e(TAG, "Couldn't find installer for " + packageName, re);
                Slog.e(TAG, "Couldn't find installer for " + packageName, re);
            }
            }