Add a new tradeinmode property for testing.

This adds a new property, persist.adb.test_tradeinmode, which will allow
using trade-in mode on ro.debuggable builds for testing.

Bug: 379970773
Test: adb shell tradeinmode testing start
Change-Id: I47447f7c8cc2448cdf178de8a7afe9a6ab605838
diff --git a/private/property_contexts b/private/property_contexts
index 672a9ad..1e70fa2 100644
--- a/private/property_contexts
+++ b/private/property_contexts
@@ -52,6 +52,7 @@
 service.adb.root        u:object_r:shell_prop:s0
 service.adb.tls.port    u:object_r:adbd_prop:s0
 persist.adb.tradeinmode u:object_r:adbd_tradeinmode_prop:s0
+persist.adb.test_tradeinmode u:object_r:adbd_tradeinmode_prop:s0
 persist.adb.wifi.       u:object_r:adbd_prop:s0
 persist.adb.tls_server.enable  u:object_r:system_adbd_prop:s0
 
diff --git a/private/tradeinmode.te b/private/tradeinmode.te
index 99035f8..18cf452 100644
--- a/private/tradeinmode.te
+++ b/private/tradeinmode.te
@@ -6,6 +6,9 @@
 allow tradeinmode adbd_tradeinmode:fd use;
 allow tradeinmode adbd_tradeinmode:unix_stream_socket { read write ioctl };
 
+# Needed to enable trade-in mode for testing.
+set_prop(tradeinmode, adbd_tradeinmode_prop)
+
 # Allow running from normal shell.
 allow tradeinmode { adbd shell }:fd use;
 allow tradeinmode adbd:unix_stream_socket { read write ioctl };