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

Commit 76acfdd6 authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN Committed by Automerger Merge Worker
Browse files

Merge "Remove DhcpResults from NetworkStack shared lib" am: f1a5da71 am: 227567d1

Original change: https://android-review.googlesource.com/c/platform/packages/modules/NetworkStack/+/1277444

Change-Id: I9a1ae3c5021062f65ad746ea85f43aca1066d60e
parents 76f71fa3 227567d1
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ filegroup {
    srcs: [
        "src/android/net/util/SharedLog.java",
        "src/android/net/shared/InitialConfiguration.java",
        "src/android/net/shared/IpConfigurationParcelableUtil.java",
        "src/android/net/shared/Layer2Information.java",
        "src/android/net/shared/LinkPropertiesParcelableUtil.java",
        "src/android/net/shared/ParcelableUtil.java",
+1 −0
Original line number Diff line number Diff line
@@ -124,6 +124,7 @@ java_library {
        "src/android/net/IpMemoryStoreClient.java",
        "src/android/net/ipmemorystore/**/*.java",
        "src/android/net/networkstack/**/*.java",
        "src/android/net/shared/**/*.java",
    ],
    static_libs: [
        "ipmemorystore-aidl-interfaces-java",
+48 −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.net.shared;

import android.annotation.Nullable;
import android.net.InetAddresses;

import java.net.InetAddress;

/**
 * Collection of utility methods to convert to and from stable AIDL parcelables for IpClient
 * configuration classes.
 * @hide
 */
public final class IpConfigurationParcelableUtil {

    /**
     * Convert InetAddress to String.
     * TODO: have an InetAddressParcelable
     */
    public static String parcelAddress(@Nullable InetAddress addr) {
        if (addr == null) return null;
        return addr.getHostAddress();
    }

    /**
     * Convert String to InetAddress.
     * TODO: have an InetAddressParcelable
     */
    public static InetAddress unparcelAddress(@Nullable String addr) {
        if (addr == null) return null;
        return InetAddresses.parseNumericAddress(addr);
    }
}
+9 −27
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 * 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.
@@ -14,22 +14,22 @@
 * limitations under the License.
 */

package android.net.shared;
package android.net.dhcp;

import static android.net.shared.IpConfigurationParcelableUtil.parcelAddress;
import static android.net.shared.IpConfigurationParcelableUtil.unparcelAddress;

import android.annotation.Nullable;
import android.net.DhcpResults;
import android.net.DhcpResultsParcelable;
import android.net.InetAddresses;

import androidx.annotation.Nullable;

import java.net.Inet4Address;
import java.net.InetAddress;

/**
 * Collection of utility methods to convert to and from stable AIDL parcelables for IpClient
 * configuration classes.
 * @hide
 * A utility class to convert DhcpResults to DhcpResultsParcelable.
 */
public final class IpConfigurationParcelableUtil {
public final class DhcpResultsParcelableUtil {
    /**
     * Convert DhcpResults to a DhcpResultsParcelable.
     */
@@ -60,22 +60,4 @@ public final class IpConfigurationParcelableUtil {
        results.captivePortalApiUrl = p.captivePortalApiUrl;
        return results;
    }

    /**
     * Convert InetAddress to String.
     * TODO: have an InetAddressParcelable
     */
    public static String parcelAddress(@Nullable InetAddress addr) {
        if (addr == null) return null;
        return addr.getHostAddress();
    }

    /**
     * Convert String to InetAddress.
     * TODO: have an InetAddressParcelable
     */
    public static InetAddress unparcelAddress(@Nullable String addr) {
        if (addr == null) return null;
        return InetAddresses.parseNumericAddress(addr);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
package android.net.ip;

import static android.net.RouteInfo.RTN_UNICAST;
import static android.net.shared.IpConfigurationParcelableUtil.toStableParcelable;
import static android.net.dhcp.DhcpResultsParcelableUtil.toStableParcelable;
import static android.provider.DeviceConfig.NAMESPACE_CONNECTIVITY;

import static com.android.server.util.NetworkStackConstants.VENDOR_SPECIFIC_IE_ID;
Loading