Broadcast upstream interface change event for IPV6
On change in tethering upstream interface for IPV6 address, broadcast
an intent with the information viz iface name, ip address type and
update type(i.e. add or delete). This changelist is update to
Change-Id: Ia80738bcf09692209674a47b6c6c1c082a201b16 for IPV6
tethering support.
Change-Id: I2e3da6e6b881ef1eb0f673c8d293f10c250ccd93
CRs-Fixed: 721222
diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java
index eaf6edd..550b908 100644
--- a/services/core/java/com/android/server/connectivity/Tethering.java
+++ b/services/core/java/com/android/server/connectivity/Tethering.java
@@ -887,6 +887,12 @@
}
}
+ public String getTethered() {
+ synchronized (Tethering.this.mPublicSync) {
+ return mIfaceName;
+ }
+ }
+
private void setTethered(boolean tethered) {
synchronized (Tethering.this.mPublicSync) {
mTethered = tethered;
@@ -1326,6 +1332,10 @@
Log.d(TAG, "adding v6 interface " + iface);
try {
service.addUpstreamV6Interface(iface);
+ for (TetherInterfaceSM sm : mNotifyList) {
+ sendUpstreamIfaceChangeBroadcast( iface, sm.getTethered(), AF_INET6,
+ UpstreamInfoUpdateType.UPSTREAM_IFACE_ADDED);
+ }
} catch (RemoteException e) {
Log.e(TAG, "Unable to append v6 upstream interface");
}
@@ -1338,6 +1348,10 @@
Log.d(TAG, "removing v6 interface " + iface);
try {
service.removeUpstreamV6Interface(iface);
+ for (TetherInterfaceSM sm : mNotifyList) {
+ sendUpstreamIfaceChangeBroadcast( iface, sm.getTethered(), AF_INET6,
+ UpstreamInfoUpdateType.UPSTREAM_IFACE_REMOVED);
+ }
} catch (RemoteException e) {
Log.e(TAG, "Unable to remove v6 upstream interface");
}