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

Commit 95213512 authored by Chalard Jean's avatar Chalard Jean Committed by Xiao Ma
Browse files

Move the IpMemoryStore to the network stack.

Test: atest FrameworksNetTests
Change-Id: Ic5bd6ff54b09a6fa92b6863f240a5b053011acb6
parent 205886d2
Loading
Loading
Loading
Loading
+24 −6
Original line number Diff line number Diff line
@@ -841,6 +841,9 @@ aidl_interface {
        "core/java/android/net/dhcp/IDhcpServerCallbacks.aidl",
        "core/java/android/net/ip/IIpClient.aidl",
        "core/java/android/net/ip/IIpClientCallbacks.aidl",
        "core/java/android/net/IIpMemoryStore.aidl",
        "core/java/android/net/IIpMemoryStoreCallbacks.aidl",
        "core/java/android/net/ipmemorystore/**/*.aidl",
    ],
    backend: {
        ndk: {
@@ -854,29 +857,44 @@ aidl_interface {
}

aidl_interface {
    name: "networkstack-aidl-framework",
    name: "ipmemorystore-aidl-interfaces",
    local_include_dir: "core/java",
    srcs: [
        "core/java/android/net/TcpKeepalivePacketDataParcelable.aidl",
        "core/java/android/net/IIpMemoryStore.aidl",
        "core/java/android/net/IIpMemoryStoreCallbacks.aidl",
        "core/java/android/net/ipmemorystore/**/*.aidl",
    ],
}

aidl_interface {
    name: "networkstack-aidl-framework",
    local_include_dir: "core/java",
    srcs: [
        "core/java/android/net/TcpKeepalivePacketDataParcelable.aidl",
    ],
    api_dir: "aidl/networkstack",
}

filegroup {
    name: "framework-networkstack-shared-srcs",
    name: "framework-annotations",
    srcs: [
        // TODO: remove these annotations as soon as we can use andoid.support.annotations.*
        "core/java/android/annotation/NonNull.java",
        "core/java/android/annotation/Nullable.java",
        "core/java/android/annotation/IntDef.java",
        "core/java/android/annotation/IntRange.java",
        "core/java/android/annotation/UnsupportedAppUsage.java",
        "core/java/android/net/DhcpResults.java",
        "core/java/android/util/LocalLog.java",
        "core/java/com/android/internal/annotations/GuardedBy.java",
        "core/java/com/android/internal/annotations/VisibleForTesting.java",
    ]
}

filegroup {
    name: "framework-networkstack-shared-srcs",
    srcs: [
        // TODO: remove these annotations as soon as we can use andoid.support.annotations.*
        ":framework-annotations",
        "core/java/android/net/DhcpResults.java",
        "core/java/android/util/LocalLog.java",
        "core/java/com/android/internal/util/HexDump.java",
        "core/java/com/android/internal/util/IndentingPrintWriter.java",
        "core/java/com/android/internal/util/IState.java",
+0 −13
Original line number Diff line number Diff line
@@ -81,11 +81,9 @@ import android.net.ConnectivityThread;
import android.net.EthernetManager;
import android.net.IConnectivityManager;
import android.net.IEthernetManager;
import android.net.IIpMemoryStore;
import android.net.IIpSecService;
import android.net.INetworkPolicyManager;
import android.net.ITestNetworkManager;
import android.net.IpMemoryStore;
import android.net.IpSecManager;
import android.net.NetworkPolicyManager;
import android.net.NetworkScoreManager;
@@ -298,17 +296,6 @@ final class SystemServiceRegistry {
            }
        });

        registerService(Context.IP_MEMORY_STORE_SERVICE, IpMemoryStore.class,
                new CachedServiceFetcher<IpMemoryStore>() {
                    @Override
                    public IpMemoryStore createService(final ContextImpl ctx)
                            throws ServiceNotFoundException {
                        IBinder b = ServiceManager.getServiceOrThrow(
                                Context.IP_MEMORY_STORE_SERVICE);
                        IIpMemoryStore service = IIpMemoryStore.Stub.asInterface(b);
                        return new IpMemoryStore(ctx, service);
                    }});

        registerService(Context.IPSEC_SERVICE, IpSecManager.class,
                new CachedServiceFetcher<IpSecManager>() {
            @Override
+0 −8
Original line number Diff line number Diff line
@@ -3521,14 +3521,6 @@ public abstract class Context {
     */
    public static final String NETWORK_STACK_SERVICE = "network_stack";

    /**
     * Use with {@link #getSystemService(String)} to retrieve a
     * {@link android.net.IpMemoryStore} to store and read information about
     * known networks.
     * @hide
     */
    public static final String IP_MEMORY_STORE_SERVICE = "ipmemorystore";

    /**
     * Use with {@link #getSystemService(String)} to retrieve a
     * {@link android.net.IpSecManager} for encrypting Sockets or Networks with
+24 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 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;

import android.net.IIpMemoryStore;

/** {@hide} */
oneway interface IIpMemoryStoreCallbacks {
    void onIpMemoryStoreFetched(in IIpMemoryStore ipMemoryStore);
}
+3 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package android.net;

import android.net.IIpMemoryStoreCallbacks;
import android.net.INetworkMonitorCallbacks;
import android.net.Network;
import android.net.dhcp.DhcpServingParamsParcel;
@@ -27,4 +28,5 @@ oneway interface INetworkStackConnector {
        in IDhcpServerCallbacks cb);
    void makeNetworkMonitor(in Network network, String name, in INetworkMonitorCallbacks cb);
    void makeIpClient(in String ifName, in IIpClientCallbacks callbacks);
    void fetchIpMemoryStore(in IIpMemoryStoreCallbacks cb);
}
Loading