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

Commit e72055eb authored by Xiao Ma's avatar Xiao Ma
Browse files

Add onReachabilityFailure api in IIpClientCallbacks aidl.

The new API is called when neighbor reachability loss event happens
since networkstack-aidl-interfaces-V13, this CL also defines a few
associated constants representing different neighbor reachability
loss events and a stable parcelable as the parameter.

Bug: 204723906
Test: atest NetworkStackTests
Change-Id: Ie6382206de2107aa4654f0628f2f446017d7ea34
parent 10ab4c90
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -102,6 +102,8 @@ aidl_interface {
        // New AIDL classes should go into android.net.networkstack.aidl so they can be clearly
        // identified
        "src/android/net/networkstack/aidl/dhcp/DhcpOption.aidl",
        "src/android/net/networkstack/aidl/ip/ReachabilityLossInfoParcelable.aidl",
        "src/android/net/networkstack/aidl/ip/ReachabilityLossReason.aidl",
    ],
    backend: {
        java: {
+1 −0
Original line number Diff line number Diff line
@@ -48,4 +48,5 @@ interface IIpClientCallbacks {
  oneway void setFallbackMulticastFilter(boolean enabled);
  oneway void setNeighborDiscoveryOffload(boolean enable);
  oneway void onPreconnectionStart(in List<android.net.Layer2PacketParcelable> packets);
  oneway void onReachabilityFailure(in android.net.networkstack.aidl.ip.ReachabilityLossInfoParcelable lossInfo);
}
+39 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 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.
 */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.net.networkstack.aidl.ip;
@JavaDerive(equals=true, toString=true) @JavaOnlyImmutable
parcelable ReachabilityLossInfoParcelable {
  String message;
  android.net.networkstack.aidl.ip.ReachabilityLossReason reason;
}
+40 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 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.
 */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.net.networkstack.aidl.ip;
@Backing(type="int")
enum ReachabilityLossReason {
  ROAM = 0,
  CONFIRM = 1,
  ORGANIC = 2,
}
+5 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.net.ip;
import android.net.Layer2PacketParcelable;
import android.net.LinkProperties;
import android.net.ip.IIpClient;
import android.net.networkstack.aidl.ip.ReachabilityLossInfoParcelable;
import android.net.DhcpResultsParcelable;

/** @hide */
@@ -67,4 +68,8 @@ oneway interface IIpClientCallbacks {

    // Invoked on starting preconnection process.
    void onPreconnectionStart(in List<Layer2PacketParcelable> packets);

    // Called when the internal IpReachabilityMonitor (if enabled) has detected the loss of a
    // critical number of required neighbors or DHCP roaming fails.
    void onReachabilityFailure(in ReachabilityLossInfoParcelable lossInfo);
}
Loading