summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2021-01-18 17:40:34 +0900
committerLorenzo Colitti <lorenzo@google.com>2021-03-10 14:58:05 +0900
commit929287213dc673ef870eb194423872315e38695e (patch)
treed77f3dc6c31a46828b70726597b00090f91fb8a6
parent8ab7e133323376d79d280ba60f2d994bfd9a9ab9 (diff)
downloadandroid-clat-929287213dc673ef870eb194423872315e38695e.tar.gz
Copy the 464xlat vendor property to an AOSP property.
Test: manual Bug: 182333299 Change-Id: I88d570911d4afd0c4123ca7f50c6e7cf3b40b42b
-rw-r--r--Android.bp4
-rw-r--r--vendor-464xlat.rc15
2 files changed, 19 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
index ac24a00..4ab797f 100644
--- a/Android.bp
+++ b/Android.bp
@@ -63,6 +63,10 @@ cc_binary {
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