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

Commit 5fe91f8d authored by Ryuki Nakamura's avatar Ryuki Nakamura Committed by Philip P. Moltmann
Browse files

Read and apply 'packageName'

Bug: 30056625
Change-Id: Ie8e46fc7a2c340fb04b64feb331af0d882fe9672
parent a0649f3e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.content.pm.PackageInstaller;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.PackageParser;
import android.content.pm.PackageParser.PackageLite;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Bundle;
@@ -356,7 +357,9 @@ public class InstallAppProgress extends Activity implements View.OnClickListener

            File file = new File(mPackageURI.getPath());
            try {
                params.setInstallLocation(PackageParser.parsePackageLite(file, 0).installLocation);
                PackageLite pkg = PackageParser.parsePackageLite(file, 0);
                params.sessionParams.setAppPackageName(pkg.packageName);
                params.setInstallLocation(pkg.installLocation);
            } catch (PackageParser.PackageParserException e) {
                Log.e(TAG, "Cannot parse package " + file + ". Assuming defaults.");
            }