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

Commit 5e0a1d5c authored by Winson's avatar Winson
Browse files

ParsingPackage/ParsedPackage split source migration

Part of the Parsing/ParsedPackage split into core/server.

This migrates any core/services source with trivially reviewable
changes. Import changes, moving files around, or generally
small single line changes scattered throughout all code that
depended on the old state of the package code.

Bug: 135203078

Test: enumerated in first commit of change ID
		Ib4fe51d729a56bfb0ea1316e577358ba0dfceccf

Change-Id: If091641a81be2d943d1d3e4a3d654e200d0ce59d
parent e23ae20e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -393,7 +393,7 @@ java_defaults {

    exclude_srcs: [
        // See comment on framework-atb-backward-compatibility module below
        "core/java/android/content/pm/parsing/library/AndroidTestBaseUpdater.java",
        "core/java/android/content/pm/AndroidTestBaseUpdater.java",
    ],

    sdk_version: "core_platform",
@@ -597,7 +597,7 @@ java_library {
    installable: true,
    libs: ["app-compat-annotations"],
    srcs: [
        "core/java/android/content/pm/parsing/library/AndroidTestBaseUpdater.java",
        "core/java/android/content/pm/AndroidTestBaseUpdater.java",
    ],
}

+26 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.content.pm;

/**
 * Dummy class to maintain legacy behavior of including a class in core source to toggle
 * whether or not a shared library is stripped at build time.
 *
 * @hide
 */
public class AndroidTestBaseUpdater {
}
+1 −7
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import static android.os.Build.VERSION_CODES.O;
import static android.os.Trace.TRACE_TAG_PACKAGE_MANAGER;
import static android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_UNSPECIFIED;

import android.annotation.AnyThread;
import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
@@ -56,12 +55,7 @@ import android.compat.annotation.UnsupportedAppUsage;
import android.content.ComponentName;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageParserCacheHelper.ReadHelper;
import android.content.pm.PackageParserCacheHelper.WriteHelper;
import android.content.pm.parsing.AndroidPackage;
import android.content.pm.parsing.ApkParseUtils;
import android.content.pm.parsing.PackageImpl;
import android.content.pm.parsing.ParsedPackage;
import android.content.pm.parsing.ParsingPackageUtils;
import android.content.pm.permission.SplitPermissionInfoParcelable;
import android.content.pm.split.DefaultSplitAssetLoader;
import android.content.pm.split.SplitAssetDependencyLoader;
+3 −3
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ import static android.content.pm.PackageManager.MATCH_DISABLED_UNTIL_USED_COMPON
import static android.content.pm.PackageManager.MATCH_SYSTEM_ONLY;

import android.compat.annotation.UnsupportedAppUsage;
import android.content.pm.parsing.ComponentParseUtils;
import android.content.pm.parsing.ComponentParseUtils.ParsedMainComponent;
import android.os.BaseBundle;
import android.os.Debug;
import android.os.PersistableBundle;
@@ -163,7 +163,7 @@ public class PackageUserState {
    }

    public boolean isMatch(boolean isSystem, boolean isPackageEnabled,
            ComponentParseUtils.ParsedComponent component, int flags) {
            ParsedMainComponent component, int flags) {
        return isMatch(isSystem, isPackageEnabled, component.isEnabled(),
                component.isDirectBootAware(), component.getName(), flags);
    }
@@ -217,7 +217,7 @@ public class PackageUserState {
    }

    public boolean isEnabled(boolean isPackageEnabled,
            ComponentParseUtils.ParsedComponent parsedComponent, int flags) {
            ParsedMainComponent parsedComponent, int flags) {
        return isEnabled(isPackageEnabled, parsedComponent.isEnabled(), parsedComponent.getName(),
                flags);
    }
+0 −23
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.pm.parsing.AndroidPackage;
import android.os.Parcel;
import android.os.Parcelable;

@@ -38,28 +37,6 @@ import java.util.List;
 */
public final class SharedLibraryInfo implements Parcelable {

    /** @hide */
    public static SharedLibraryInfo createForStatic(AndroidPackage pkg) {
        return new SharedLibraryInfo(null, pkg.getPackageName(),
                pkg.makeListAllCodePaths(),
                pkg.getStaticSharedLibName(),
                pkg.getStaticSharedLibVersion(),
                TYPE_STATIC,
                new VersionedPackage(pkg.getManifestPackageName(),
                        pkg.getLongVersionCode()),
                null, null);
    }

    /** @hide */
    public static SharedLibraryInfo createForDynamic(AndroidPackage pkg, String name) {
        return new SharedLibraryInfo(null, pkg.getPackageName(),
                pkg.makeListAllCodePaths(), name,
                (long) VERSION_UNDEFINED,
                TYPE_DYNAMIC, new VersionedPackage(pkg.getPackageName(),
                pkg.getLongVersionCode()),
                null, null);
    }

    /** @hide */
    @IntDef(flag = true, prefix = { "TYPE_" }, value = {
            TYPE_BUILTIN,
Loading