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

Commit 77b13fd3 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Fix various issues in ordering of grouped bindings."

parents 6f5ea0c1 2f55e5a9
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -1731,8 +1731,11 @@ class ContextImpl extends Context {
            throw new IllegalArgumentException("connection is null");
            throw new IllegalArgumentException("connection is null");
        }
        }
        if (mPackageInfo != null) {
        if (mPackageInfo != null) {
            IServiceConnection sd = mPackageInfo.forgetServiceDispatcher(
            IServiceConnection sd = mPackageInfo.lookupServiceDispatcher(conn, getOuterContext());
                    getOuterContext(), conn);
            if (sd == null) {
                throw new IllegalArgumentException("ServiceConnection not currently bound: "
                        + conn);
            }
            try {
            try {
                ActivityManager.getService().updateServiceGroup(sd, group, importance);
                ActivityManager.getService().updateServiceGroup(sd, group, importance);
            } catch (RemoteException e) {
            } catch (RemoteException e) {
+13 −0
Original line number Original line Diff line number Diff line
@@ -1659,6 +1659,19 @@ public final class LoadedApk {
        }
        }
    }
    }


    @UnsupportedAppUsage
    public IServiceConnection lookupServiceDispatcher(ServiceConnection c,
            Context context) {
        synchronized (mServices) {
            LoadedApk.ServiceDispatcher sd = null;
            ArrayMap<ServiceConnection, LoadedApk.ServiceDispatcher> map = mServices.get(context);
            if (map != null) {
                sd = map.get(c);
            }
            return sd != null ? sd.getIServiceConnection() : null;
        }
    }

    public final IServiceConnection forgetServiceDispatcher(Context context,
    public final IServiceConnection forgetServiceDispatcher(Context context,
            ServiceConnection c) {
            ServiceConnection c) {
        synchronized (mServices) {
        synchronized (mServices) {
+5 −0
Original line number Original line Diff line number Diff line
@@ -3003,6 +3003,11 @@ public abstract class Context {
     * how the process will be managed in some cases based on those flags.  Currently only
     * how the process will be managed in some cases based on those flags.  Currently only
     * works on isolated processes (will be ignored for non-isolated processes).
     * works on isolated processes (will be ignored for non-isolated processes).
     *
     *
     * <p>Note that this call does not take immediate effect, but will be applied the next
     * time the impacted process is adjusted for some other reason.  Typically you would
     * call this before then calling a new {@link #bindIsolatedService} on the service
     * of interest, with that binding causing the process to be shuffled accordingly.</p>
     *
     * @param conn The connection interface previously supplied to bindService().  This
     * @param conn The connection interface previously supplied to bindService().  This
     *             parameter must not be null.
     *             parameter must not be null.
     * @param group A group to put this connection's process in.  Upon calling here, this
     * @param group A group to put this connection's process in.  Upon calling here, this
+1 −1
Original line number Original line Diff line number Diff line
@@ -1303,7 +1303,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
    /** {@hide} */
    /** {@hide} */
    public void writeToProto(ProtoOutputStream proto, long fieldId, int dumpFlags) {
    public void writeToProto(ProtoOutputStream proto, long fieldId, int dumpFlags) {
        long token = proto.start(fieldId);
        long token = proto.start(fieldId);
        super.writeToProto(proto, ApplicationInfoProto.PACKAGE);
        super.writeToProto(proto, ApplicationInfoProto.PACKAGE, dumpFlags);
        proto.write(ApplicationInfoProto.PERMISSION, permission);
        proto.write(ApplicationInfoProto.PERMISSION, permission);
        proto.write(ApplicationInfoProto.PROCESS_NAME, processName);
        proto.write(ApplicationInfoProto.PROCESS_NAME, processName);
        proto.write(ApplicationInfoProto.UID, uid);
        proto.write(ApplicationInfoProto.UID, uid);
+5 −5
Original line number Original line Diff line number Diff line
@@ -433,18 +433,18 @@ public class PackageItemInfo {
    /**
    /**
     * @hide
     * @hide
     */
     */
    public void writeToProto(ProtoOutputStream proto, long fieldId) {
    public void writeToProto(ProtoOutputStream proto, long fieldId, int dumpFlags) {
        long token = proto.start(fieldId);
        long token = proto.start(fieldId);
        if (name != null) {
        if (name != null) {
            proto.write(PackageItemInfoProto.NAME, name);
            proto.write(PackageItemInfoProto.NAME, name);
        }
        }
        proto.write(PackageItemInfoProto.PACKAGE_NAME, packageName);
        proto.write(PackageItemInfoProto.PACKAGE_NAME, packageName);
        if (labelRes != 0 || nonLocalizedLabel != null || icon != 0 || banner != 0) {
        proto.write(PackageItemInfoProto.LABEL_RES, labelRes);
        proto.write(PackageItemInfoProto.LABEL_RES, labelRes);
        if (nonLocalizedLabel != null) {
            proto.write(PackageItemInfoProto.NON_LOCALIZED_LABEL, nonLocalizedLabel.toString());
            proto.write(PackageItemInfoProto.NON_LOCALIZED_LABEL, nonLocalizedLabel.toString());
        }
        proto.write(PackageItemInfoProto.ICON, icon);
        proto.write(PackageItemInfoProto.ICON, icon);
        proto.write(PackageItemInfoProto.BANNER, banner);
        proto.write(PackageItemInfoProto.BANNER, banner);
        }
        proto.end(token);
        proto.end(token);
    }
    }


Loading