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

Commit 1627e3cb authored by Hunter Knepshield's avatar Hunter Knepshield Committed by Automerger Merge Worker
Browse files

Merge changes from topic "bugreport-stub" into rvc-dev am: 95689602 am: a7dad0b5

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11856802

Change-Id: I31559d76a4c97fbbdd528e2647ca8be6081d08b1
parents 4fb95e64 a7dad0b5
Loading
Loading
Loading
Loading
+19 −0
Original line number Original line 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.os;

parcelable CarrierAssociatedAppEntry;
+68 −0
Original line number Original line 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.os;

/**
 * Represents a carrier app entry for use with {@link SystemConfigService}.
 *
 * @hide
 */
public final class CarrierAssociatedAppEntry implements Parcelable {

    /**
     * For carrier-associated app entries that don't specify the addedInSdk XML
     * attribute.
     */
    public static final int SDK_UNSPECIFIED = -1;

    public final String packageName;
    /** May be {@link #SDK_UNSPECIFIED}. */
    public final int addedInSdk;

    public CarrierAssociatedAppEntry(String packageName, int addedInSdk) {
        this.packageName = packageName;
        this.addedInSdk = addedInSdk;
    }

    public CarrierAssociatedAppEntry(Parcel in) {
        packageName = in.readString();
        addedInSdk = in.readInt();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(packageName);
        dest.writeInt(addedInSdk);
    }

    public static final Parcelable.Creator<CarrierAssociatedAppEntry> CREATOR =
            new Parcelable.Creator<CarrierAssociatedAppEntry>() {
        @Override
        public CarrierAssociatedAppEntry createFromParcel(Parcel source) {
            return new CarrierAssociatedAppEntry(source);
        }

        @Override
        public CarrierAssociatedAppEntry[] newArray(int size) {
            return new CarrierAssociatedAppEntry[size];
        }
    };
}
+5 −0
Original line number Original line Diff line number Diff line
@@ -30,4 +30,9 @@ interface ISystemConfig {
     * @see SystemConfigManager#getDisabledUntilUsedPreinstalledCarrierAssociatedApps
     * @see SystemConfigManager#getDisabledUntilUsedPreinstalledCarrierAssociatedApps
     */
     */
    Map getDisabledUntilUsedPreinstalledCarrierAssociatedApps();
    Map getDisabledUntilUsedPreinstalledCarrierAssociatedApps();

    /**
     * @see SystemConfigManager#getDisabledUntilUsedPreinstalledCarrierAssociatedAppEntries
     */
    Map getDisabledUntilUsedPreinstalledCarrierAssociatedAppEntries();
}
}
+25 −0
Original line number Original line Diff line number Diff line
@@ -88,4 +88,29 @@ public class SystemConfigManager {
            return Collections.emptyMap();
            return Collections.emptyMap();
        }
        }
    }
    }

    /**
     * Returns a map that describes helper apps associated with carrier apps that, like the apps
     * returned by {@link #getDisabledUntilUsedPreinstalledCarrierApps()}, should be disabled until
     * the correct SIM is inserted into the device.
     *
     * <p>TODO(b/159069037) expose this and get rid of the other method that omits SDK version.
     *
     * @return A map with keys corresponding to package names returned by
     *         {@link #getDisabledUntilUsedPreinstalledCarrierApps()} and values as lists of package
     *         names of helper apps and the SDK versions when they were first added.
     *
     * @hide
     */
    @RequiresPermission(Manifest.permission.READ_CARRIER_APP_INFO)
    public @NonNull Map<String, List<CarrierAssociatedAppEntry>>
            getDisabledUntilUsedPreinstalledCarrierAssociatedAppEntries() {
        try {
            return (Map<String, List<CarrierAssociatedAppEntry>>)
                    mInterface.getDisabledUntilUsedPreinstalledCarrierAssociatedAppEntries();
        } catch (RemoteException e) {
            Log.e(TAG, "Caught remote exception", e);
            return Collections.emptyMap();
        }
    }
}
}
+4 −3
Original line number Original line Diff line number Diff line
@@ -8521,14 +8521,15 @@ public final class Settings {
        public static final int VR_DISPLAY_MODE_OFF = 1;
        public static final int VR_DISPLAY_MODE_OFF = 1;
        /**
        /**
         * Whether CarrierAppUtils#disableCarrierAppsUntilPrivileged has been executed at least
         * The latest SDK version that CarrierAppUtils#disableCarrierAppsUntilPrivileged has been
         * once.
         * executed for.
         *
         *
         * <p>This is used to ensure that we only take one pass which will disable apps that are not
         * <p>This is used to ensure that we only take one pass which will disable apps that are not
         * privileged (if any). From then on, we only want to enable apps (when a matching SIM is
         * privileged (if any). From then on, we only want to enable apps (when a matching SIM is
         * inserted), to avoid disabling an app that the user might actively be using.
         * inserted), to avoid disabling an app that the user might actively be using.
         *
         *
         * <p>Will be set to 1 once executed.
         * <p>Will be set to {@link android.os.Build.VERSION#SDK_INT} once executed. Note that older
         * SDK versions prior to R set 1 for this value.
         *
         *
         * @hide
         * @hide
         */
         */
Loading