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

Commit 13068a57 authored by Songchun Fan's avatar Songchun Fan
Browse files

Enable basic incremental installation

1. Skip extractNativeLibs
2. Skip native library configurations
2. Skip SELinux restorecon

Test: manual
Change-Id: I71c86325e08ceea0c05426263fd5b09413cec6be
parent b1aff32b
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -458,8 +458,20 @@ public class NativeLibraryHelper {
     */
    public static int configureNativeBinariesForSupportedAbi(AndroidPackage pkg, Handle handle,
            File libraryRoot, String[] abiList, boolean useIsaSubdir) {
        // TODO(b/136132412): Implement this.
        return -1;
        int abi = findSupportedAbi(handle, abiList);
        if (abi < 0) {
            Slog.e(TAG, "Failed to find find matching ABI.");
            return abi;
        }

        // Currently only support installations that have pre-configured native library files
        // TODO(b/136132412): implement this after incfs supports file mapping
        if (!libraryRoot.exists()) {
            Slog.e(TAG, "Incremental installation currently does not configure native libs");
            return INSTALL_FAILED_NO_MATCHING_ABIS;
        }

        return abi;
    }

    // We don't care about the other return values for now.
+4 −3
Original line number Diff line number Diff line
@@ -1517,10 +1517,11 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
                mInternalProgress = 0.5f;
                computeProgressLocked(true);

                // Unpack native libraries
                // TODO(b/136132412): skip for incremental installation
                // Unpack native libraries for non-incremental installation
                if (params.incrementalParams == null) {
                    extractNativeLibraries(stageDir, params.abiOverride, mayInheritNativeLibs());
                }
            }

            // We've reached point of no return; call into PMS to install the stage.
            // Regardless of success or failure we always destroy session.
+2 −1
Original line number Diff line number Diff line
@@ -14608,7 +14608,8 @@ public class PackageManagerService extends IPackageManager.Stub
                return false;
            }
            if (!SELinux.restoreconRecursive(afterCodeFile)) {
            //TODO(b/136132412): enable selinux restorecon for incremental directories
            if (!onIncremental && !SELinux.restoreconRecursive(afterCodeFile)) {
                Slog.w(TAG, "Failed to restorecon");
                return false;
            }