Add RECEIVER_EXPORTED flag to NetworkStack API Shims

Android T adds support to allow a runtime receiver to be registered as
not exported, but to ensure apps can take advantage of this, calls to
registerReceiver must specify a flag indicating whether the receiver
should be exported for apps targeting T+ that are registering for
non-system broadcasts. This commit adds the RECEIVER_EXPORTED
flag to the API shims for code or tests that require exporting
a dynamic receiver.

Bug: 217654947
Test: atest HostsideRestrictBackgroundNetworkTests#testAppIdle_toast
Change-Id: Ic7e621646db3b703bed905f01bbcf3adf22f5523
diff --git a/Android.bp b/Android.bp
index cfe9353..8faae86 100644
--- a/Android.bp
+++ b/Android.bp
@@ -220,8 +220,7 @@
         "//packages/modules/Connectivity/Tethering",
         "//packages/modules/Connectivity/service",
         "//packages/modules/Connectivity/service-t",
-        "//packages/modules/Connectivity/tests/cts/net",
-        "//packages/modules/Connectivity/tests/cts/hostside/app",
+        "//packages/modules/Connectivity/tests/cts:__subpackages__",
     ],
 }
 
diff --git a/apishim/31/com/android/networkstack/apishim/api31/ConstantsShim.java b/apishim/31/com/android/networkstack/apishim/api31/ConstantsShim.java
index e73e7f5..5ceb191 100644
--- a/apishim/31/com/android/networkstack/apishim/api31/ConstantsShim.java
+++ b/apishim/31/com/android/networkstack/apishim/api31/ConstantsShim.java
@@ -36,6 +36,12 @@
     public static final int TRANSPORT_TEST = 7;
 
     /**
+     * Flag for {@link #registerReceiver}: The receiver can receive broadcasts from other apps;
+     * has the same behavior as marking a statically registered receiver with "exported=true".
+     */
+    public static final int RECEIVER_EXPORTED = 0x2;
+
+    /**
      * Flag for {@link android.content.Context#registerReceiver}: The receiver cannot receive
      * broadcasts from other apps; has the same behavior as marking a statically registered receiver
      * with "exported=false".