Copy the 464xlat vendor property to an AOSP property.
Test: manual
Bug: 182333299
Change-Id: I88d570911d4afd0c4123ca7f50c6e7cf3b40b42b
diff --git a/Android.bp b/Android.bp
index ac24a00..4ab797f 100644
--- a/Android.bp
+++ b/Android.bp
@@ -63,6 +63,10 @@
tidy_flags: [
"-warnings-as-errors=clang-analyzer-security*,cert-*,android-*",
],
+ // Actually not required for clatd itself. See comments in the rc file.
+ init_rc: [
+ "vendor-464xlat.rc",
+ ],
}
// Unit tests.
diff --git a/vendor-464xlat.rc b/vendor-464xlat.rc
new file mode 100644
index 0000000..609531d
--- /dev/null
+++ b/vendor-464xlat.rc
@@ -0,0 +1,15 @@
+# Certain vendors disable 464xlat by setting a vendor property.
+# The connectivity code in the Tethering APEX needs to disable
+# 464xlat when the property is set, but it is only allowed to
+# access non-vendor system properties. So copy the property to
+# a property available to system APIs in android.sysprop.
+#
+# Arguably this script should live close to the code that uses
+# it, but scrips in APEXes are not allowed to use "on property".
+# So put it here close to clatd, which is at least related to
+# 464xlat.
+on property:persist.vendor.net.doxlat=true
+ setprop net.464xlat.cellular.enabled true
+
+on property:persist.vendor.net.doxlat=false
+ setprop net.464xlat.cellular.enabled false