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

Commit 5d629d1a authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Move sensitive field parceling bool to constructor am: 0acf9103 am: 50eadafe am: a94ce580

Change-Id: I24188c9a7d4b496ed9205d16abe6cbd0216aacf4
parents 1634c5e5 a94ce580
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6217,6 +6217,7 @@ package android.net {
  public final class LinkProperties implements android.os.Parcelable {
    ctor public LinkProperties(@Nullable android.net.LinkProperties);
    ctor public LinkProperties(@Nullable android.net.LinkProperties, boolean);
    method public boolean addDnsServer(@NonNull java.net.InetAddress);
    method public boolean addLinkAddress(@NonNull android.net.LinkAddress);
    method public boolean addPcscfServer(@NonNull java.net.InetAddress);
@@ -6239,7 +6240,6 @@ package android.net {
    method public boolean isIpv6Provisioned();
    method public boolean isProvisioned();
    method public boolean isReachable(@NonNull java.net.InetAddress);
    method @NonNull public android.net.LinkProperties makeSensitiveFieldsParcelingCopy();
    method public boolean removeDnsServer(@NonNull java.net.InetAddress);
    method public boolean removeLinkAddress(@NonNull android.net.LinkAddress);
    method public boolean removeRoute(@NonNull android.net.RouteInfo);
+1 −1
Original line number Diff line number Diff line
@@ -1789,6 +1789,7 @@ package android.net {

  public final class LinkProperties implements android.os.Parcelable {
    ctor public LinkProperties(@Nullable android.net.LinkProperties);
    ctor public LinkProperties(@Nullable android.net.LinkProperties, boolean);
    method public boolean addDnsServer(@NonNull java.net.InetAddress);
    method public boolean addLinkAddress(@NonNull android.net.LinkAddress);
    method @Nullable public android.net.Uri getCaptivePortalApiUrl();
@@ -1803,7 +1804,6 @@ package android.net {
    method public boolean isIpv6Provisioned();
    method public boolean isProvisioned();
    method public boolean isReachable(@NonNull java.net.InetAddress);
    method @NonNull public android.net.LinkProperties makeSensitiveFieldsParcelingCopy();
    method public boolean removeDnsServer(@NonNull java.net.InetAddress);
    method public boolean removeLinkAddress(@NonNull android.net.LinkAddress);
    method public boolean removeRoute(@NonNull android.net.RouteInfo);
+13 −17
Original line number Diff line number Diff line
@@ -167,7 +167,19 @@ public final class LinkProperties implements Parcelable {
        this(source, false /* parcelSensitiveFields */);
    }

    private LinkProperties(@Nullable LinkProperties source, boolean parcelSensitiveFields) {
    /**
     * Create a copy of a {@link LinkProperties} that may preserve fields that were set
     * based on the permissions of the process that originally received it.
     *
     * <p>By default {@link LinkProperties} does not preserve such fields during parceling, as
     * they should not be shared outside of the process that receives them without appropriate
     * checks.
     * @param parcelSensitiveFields Whether the sensitive fields should be kept when parceling
     * @hide
     */
    @SystemApi
    @TestApi
    public LinkProperties(@Nullable LinkProperties source, boolean parcelSensitiveFields) {
        mParcelSensitiveFields = parcelSensitiveFields;
        if (source == null) return;
        mIfaceName = source.mIfaceName;
@@ -1582,22 +1594,6 @@ public final class LinkProperties implements Parcelable {
        return mCaptivePortalData;
    }

    /**
     * Create a copy of this {@link LinkProperties} that will preserve fields that were set
     * based on the permissions of the process that received this {@link LinkProperties}.
     *
     * <p>By default {@link LinkProperties} does not preserve such fields during parceling, as
     * they should not be shared outside of the process that receives them without appropriate
     * checks.
     * @hide
     */
    @SystemApi
    @TestApi
    @NonNull
    public LinkProperties makeSensitiveFieldsParcelingCopy() {
        return new LinkProperties(this, true /* parcelSensitiveFields */);
    }

    /**
     * Compares this {@code LinkProperties} instance against the target
     * LinkProperties in {@code obj}. Two LinkPropertieses are equal if
+1 −1
Original line number Diff line number Diff line
@@ -1713,7 +1713,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
        }

        if (checkSettingsPermission(callerPid, callerUid)) {
            return lp.makeSensitiveFieldsParcelingCopy();
            return new LinkProperties(lp, true /* parcelSensitiveFields */);
        }

        final LinkProperties newLp = new LinkProperties(lp);
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ java_library {
    name: "FrameworksNetCommonTests",
    srcs: ["java/**/*.java", "java/**/*.kt"],
    static_libs: [
        "androidx.core_core",
        "androidx.test.rules",
        "junit",
        "mockito-target-minus-junit4",
Loading