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

Commit 1f9e1b4c authored by Suchi Amalapurapu's avatar Suchi Amalapurapu
Browse files

Remove public variables in PackageManager

Dont invoke getInstallLocation for forward locked apps.
If INSTALL_ON_SDCARD is selected as default, forward locked
apps are not being installed because of conflicting flags.
parent eb6d1310
Loading
Loading
Loading
Loading
+0 −22
Original line number Diff line number Diff line
@@ -42346,28 +42346,6 @@
 visibility="public"
>
</field>
<field name="PKG_INSTALL_COMPLETE"
 type="int"
 transient="false"
 volatile="false"
 value="1"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="PKG_INSTALL_INCOMPLETE"
 type="int"
 transient="false"
 volatile="false"
 value="0"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="SIGNATURE_FIRST_NOT_SIGNED"
 type="int"
 transient="false"
+0 −22
Original line number Diff line number Diff line
@@ -45440,28 +45440,6 @@
 visibility="public"
>
</field>
<field name="PKG_INSTALL_COMPLETE"
 type="int"
 transient="false"
 volatile="false"
 value="1"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="PKG_INSTALL_INCOMPLETE"
 type="int"
 transient="false"
 volatile="false"
 value="0"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="SIGNATURE_FIRST_NOT_SIGNED"
 type="int"
 transient="false"
+0 −13
Original line number Diff line number Diff line
@@ -529,19 +529,6 @@ public abstract class PackageManager {
     */
    public static final int INSTALL_FAILED_INTERNAL_ERROR = -110;

    /**
     * Indicates the state of installation. Used by PackageManager to
     * figure out incomplete installations. Say a package is being installed
     * (the state is set to PKG_INSTALL_INCOMPLETE) and remains so till
     * the package installation is successful or unsuccesful lin which case
     * the PackageManager will no longer maintain state information associated
     * with the package. If some exception(like device freeze or battery being
     * pulled out) occurs during installation of a package, the PackageManager
     * needs this information to clean up the previously failed installation.
     */
    public static final int PKG_INSTALL_INCOMPLETE = 0;
    public static final int PKG_INSTALL_COMPLETE = 1;

    /**
     * Flag parameter for {@link #deletePackage} to indicate that you don't want to delete the
     * package's data directory.
+18 −14
Original line number Diff line number Diff line
@@ -56,8 +56,6 @@ import android.content.pm.PackageStats;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
import static android.content.pm.PackageManager.PKG_INSTALL_COMPLETE;
import static android.content.pm.PackageManager.PKG_INSTALL_INCOMPLETE;
import android.content.pm.PackageParser;
import android.content.pm.PermissionInfo;
import android.content.pm.PermissionGroupInfo;
@@ -151,6 +149,19 @@ class PackageManagerService extends IPackageManager.Stub {
    // package apks to install directory.
    private static final String INSTALL_PACKAGE_SUFFIX = "-";

    /**
     * Indicates the state of installation. Used by PackageManager to
     * figure out incomplete installations. Say a package is being installed
     * (the state is set to PKG_INSTALL_INCOMPLETE) and remains so till
     * the package installation is successful or unsuccesful lin which case
     * the PackageManager will no longer maintain state information associated
     * with the package. If some exception(like device freeze or battery being
     * pulled out) occurs during installation of a package, the PackageManager
     * needs this information to clean up the previously failed installation.
     */
    private static final int PKG_INSTALL_INCOMPLETE = 0;
    private static final int PKG_INSTALL_COMPLETE = 1;

    static final int SCAN_MONITOR = 1<<0;
    static final int SCAN_NO_DEX = 1<<1;
    static final int SCAN_FORCE_DEX = 1<<2;
@@ -4426,8 +4437,11 @@ class PackageManagerService extends IPackageManager.Stub {
        }

        public void handleStartCopy(IMediaContainerService imcs) {
            int ret = PackageManager.INSTALL_FAILED_INTERNAL_ERROR;
            if (imcs != null) {
            int ret = PackageManager.INSTALL_SUCCEEDED;
            // Dont need to invoke getInstallLocation for forward locked apps.
            if ((flags & PackageManager.INSTALL_FORWARD_LOCK) != 0) {
                flags &= ~PackageManager.INSTALL_EXTERNAL;
            } else if (imcs != null) {
                // Remote call to find out default install location
                int loc = getInstallLocation(imcs);
                // Use install location to create InstallArgs and temporary
@@ -4447,16 +4461,6 @@ class PackageManagerService extends IPackageManager.Stub {
                            flags &= ~PackageManager.INSTALL_EXTERNAL;
                        }
                    }
                    // Disable forward locked apps on sdcard.
                    if ((flags & PackageManager.INSTALL_FORWARD_LOCK) != 0 &&
                            (flags & PackageManager.INSTALL_EXTERNAL) != 0) {
                        // Make sure forward locked apps can only be installed
                        // on internal storage
                        Log.w(TAG, "Cannot install protected apps on sdcard");
                        ret = PackageManager.INSTALL_FAILED_INVALID_INSTALL_LOCATION;
                    } else {
                        ret = PackageManager.INSTALL_SUCCEEDED;
                    }
                }
            }
            // Create the file args now.