Loading packages/PackageInstaller/src/com/android/packageinstaller/InstallStart.java +11 −9 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageInstaller; import android.content.pm.PackageInstaller.SessionInfo; import android.content.pm.PackageManager; import android.content.pm.ProviderInfo; import android.net.Uri; Loading Loading @@ -65,14 +66,15 @@ public class InstallStart extends Activity { // If the activity was started via a PackageInstaller session, we retrieve the calling // package from that session final int sessionId = (isSessionInstall ? intent.getIntExtra(PackageInstaller.EXTRA_SESSION_ID, -1) : -1); if (callingPackage == null && sessionId != -1) { PackageInstaller packageInstaller = getPackageManager().getPackageInstaller(); ? intent.getIntExtra(PackageInstaller.EXTRA_SESSION_ID, SessionInfo.INVALID_ID) : SessionInfo.INVALID_ID); if (sessionId != SessionInfo.INVALID_ID) { PackageInstaller packageInstaller = mPackageManager.getPackageInstaller(); PackageInstaller.SessionInfo sessionInfo = packageInstaller.getSessionInfo(sessionId); callingPackage = (sessionInfo != null) ? sessionInfo.getInstallerPackageName() : null; callingAttributionTag = (sessionInfo != null) ? sessionInfo.getInstallerAttributionTag() : null; if (sessionInfo != null) { callingPackage = sessionInfo.getInstallerPackageName(); callingAttributionTag = sessionInfo.getInstallerAttributionTag(); } } final ApplicationInfo sourceInfo = getSourceInfo(callingPackage); Loading Loading @@ -173,7 +175,7 @@ public class InstallStart extends Activity { private ApplicationInfo getSourceInfo(@Nullable String callingPackage) { if (callingPackage != null) { try { return getPackageManager().getApplicationInfo(callingPackage, 0); return mPackageManager.getApplicationInfo(callingPackage, 0); } catch (PackageManager.NameNotFoundException ex) { // ignore } Loading Loading @@ -220,7 +222,7 @@ public class InstallStart extends Activity { } private boolean isSystemDownloadsProvider(int uid) { final ProviderInfo downloadProviderPackage = getPackageManager().resolveContentProvider( final ProviderInfo downloadProviderPackage = mPackageManager.resolveContentProvider( DOWNLOADS_AUTHORITY, 0); if (downloadProviderPackage == null) { // There seems to be no currently enabled downloads provider on the system. Loading Loading
packages/PackageInstaller/src/com/android/packageinstaller/InstallStart.java +11 −9 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageInstaller; import android.content.pm.PackageInstaller.SessionInfo; import android.content.pm.PackageManager; import android.content.pm.ProviderInfo; import android.net.Uri; Loading Loading @@ -65,14 +66,15 @@ public class InstallStart extends Activity { // If the activity was started via a PackageInstaller session, we retrieve the calling // package from that session final int sessionId = (isSessionInstall ? intent.getIntExtra(PackageInstaller.EXTRA_SESSION_ID, -1) : -1); if (callingPackage == null && sessionId != -1) { PackageInstaller packageInstaller = getPackageManager().getPackageInstaller(); ? intent.getIntExtra(PackageInstaller.EXTRA_SESSION_ID, SessionInfo.INVALID_ID) : SessionInfo.INVALID_ID); if (sessionId != SessionInfo.INVALID_ID) { PackageInstaller packageInstaller = mPackageManager.getPackageInstaller(); PackageInstaller.SessionInfo sessionInfo = packageInstaller.getSessionInfo(sessionId); callingPackage = (sessionInfo != null) ? sessionInfo.getInstallerPackageName() : null; callingAttributionTag = (sessionInfo != null) ? sessionInfo.getInstallerAttributionTag() : null; if (sessionInfo != null) { callingPackage = sessionInfo.getInstallerPackageName(); callingAttributionTag = sessionInfo.getInstallerAttributionTag(); } } final ApplicationInfo sourceInfo = getSourceInfo(callingPackage); Loading Loading @@ -173,7 +175,7 @@ public class InstallStart extends Activity { private ApplicationInfo getSourceInfo(@Nullable String callingPackage) { if (callingPackage != null) { try { return getPackageManager().getApplicationInfo(callingPackage, 0); return mPackageManager.getApplicationInfo(callingPackage, 0); } catch (PackageManager.NameNotFoundException ex) { // ignore } Loading Loading @@ -220,7 +222,7 @@ public class InstallStart extends Activity { } private boolean isSystemDownloadsProvider(int uid) { final ProviderInfo downloadProviderPackage = getPackageManager().resolveContentProvider( final ProviderInfo downloadProviderPackage = mPackageManager.resolveContentProvider( DOWNLOADS_AUTHORITY, 0); if (downloadProviderPackage == null) { // There seems to be no currently enabled downloads provider on the system. Loading