Snap for 10453563 from d212ec450807f0029bb95cb37040f9126d751761 to mainline-tzdata5-release

Change-Id: I25f9935d9e2152d86f14c05cde8b07c86d0bdad3
diff --git a/acts/framework/setup.py b/acts/framework/setup.py
index 01ac079..30b1933 100755
--- a/acts/framework/setup.py
+++ b/acts/framework/setup.py
@@ -26,7 +26,6 @@
     # Require an older version of setuptools that does not enforce PEP 440.
     # This must be added first.
     'setuptools<66.0.0',
-    'backoff',
     # Future needs to have a newer version that contains urllib.
     'future>=0.16.0',
     'mobly==1.12.0',
@@ -46,6 +45,7 @@
 ]
 
 versioned_deps = {
+    'backoff': 'backoff',
     'numpy': 'numpy',
     'scipy': 'scipy',
     'protobuf': 'protobuf==4.21.5',
@@ -58,6 +58,7 @@
     versioned_deps['numpy'] = 'numpy<1.22'
     versioned_deps['scipy'] = 'scipy<1.8'
 if sys.version_info < (3, 7):
+    versioned_deps['backoff'] = 'backoff<2.0'
     versioned_deps['numpy'] = 'numpy<1.20'
     versioned_deps['scipy'] = 'scipy<1.6'
     versioned_deps['protobuf'] = 'protobuf==3.20.1'
diff --git a/acts_tests/acts_contrib/test_utils/wifi/p2p/wifi_p2p_test_utils.py b/acts_tests/acts_contrib/test_utils/wifi/p2p/wifi_p2p_test_utils.py
index b5832d0..10f3ea0 100755
--- a/acts_tests/acts_contrib/test_utils/wifi/p2p/wifi_p2p_test_utils.py
+++ b/acts_tests/acts_contrib/test_utils/wifi/p2p/wifi_p2p_test_utils.py
@@ -339,7 +339,6 @@
     while not p2p_find_result:
         ad2.droid.wifiP2pStopPeerDiscovery()
         ad1.droid.wifiP2pStopPeerDiscovery()
-        ad2.droid.wifiP2pDiscoverPeers()
         ad1.droid.wifiP2pDiscoverPeers()
         ad1_event = ad1.ed.pop_event(p2pconsts.PEER_AVAILABLE_EVENT,
                                      p2pconsts.P2P_FIND_TIMEOUT)
diff --git a/acts_tests/tests/google/wifi/WifiBridgedApTest.py b/acts_tests/tests/google/wifi/WifiBridgedApTest.py
index b00ddae..93ae496 100644
--- a/acts_tests/tests/google/wifi/WifiBridgedApTest.py
+++ b/acts_tests/tests/google/wifi/WifiBridgedApTest.py
@@ -78,6 +78,8 @@
 
     def teardown_test(self):
         super().teardown_test()
+        # Reset unplugged status
+        self.dut.adb.shell("cmd battery reset")
         if self.dut.droid.wifiIsApEnabled():
             wutils.stop_wifi_tethering(self.dut)
         for ad in self.android_devices:
@@ -904,6 +906,8 @@
         asserts.skip_if(not is_supported, "BridgedAp is not supported in {}"
                         .format(wutils.WifiEnums.CountryCode.US))
 
+        # Simulate the unplugged scenario
+        self.dut.adb.shell("cmd battery unplug")
         # Enable BridgedAp and verify both 2G,5G instances have been enabled.
         self.enable_bridged_ap(self.dut,
                                WifiEnums.SoftApSecurityType.WPA3_SAE,
@@ -954,6 +958,8 @@
         asserts.skip_if(not is_supported, "BridgedAp is not supported in {}"
                         .format(wutils.WifiEnums.CountryCode.US))
 
+        # Simulate the unplugged scenario
+        self.dut.adb.shell("cmd battery unplug")
         # Enable BridgedAp and verify both 2G,5G instances have been enabled.
         self.enable_bridged_ap(self.dut,
                                WifiEnums.SoftApSecurityType.WPA3_SAE,
@@ -1028,6 +1034,8 @@
         asserts.skip_if(not is_supported, "BridgedAp is not supported in {}"
                         .format(wutils.WifiEnums.CountryCode.US))
 
+        # Simulate the unplugged scenario
+        self.dut.adb.shell("cmd battery unplug")
         # Enable BridgedAp and verify both 2G,5G instances have been enabled.
         self.enable_bridged_ap(self.dut,
                                WifiEnums.SoftApSecurityType.WPA3_SAE,
@@ -1129,6 +1137,8 @@
         asserts.skip_if(not is_supported, "BridgedAp is not supported in {}"
                         .format(wutils.WifiEnums.CountryCode.US))
 
+        # Simulate the unplugged scenario
+        self.dut.adb.shell("cmd battery unplug")
         # Enable BridgedAp and verify both 2G,5G instances have been enabled.
         self.enable_bridged_ap(self.dut,
                                WifiEnums.SoftApSecurityType.WPA3_SAE,
@@ -1173,6 +1183,8 @@
         asserts.skip_if(not is_supported, "BridgedAp is not supported in {}"
                         .format(wutils.WifiEnums.CountryCode.US))
 
+        # Simulate the unplugged scenario
+        self.dut.adb.shell("cmd battery unplug")
         # Enable BridgedAp and verify both 2G,5G instances have been enabled.
         self.enable_bridged_ap(self.dut,
                                WifiEnums.SoftApSecurityType.WPA3_SAE,
@@ -1223,6 +1235,8 @@
         asserts.skip_if(not is_supported, "BridgedAp is not supported in {}"
                         .format(wutils.WifiEnums.CountryCode.US))
 
+        # Simulate the unplugged scenario
+        self.dut.adb.shell("cmd battery unplug")
         # Enable BridgedAp and verify both 2G,5G instances have been enabled.
         self.enable_bridged_ap(self.dut,
                                WifiEnums.SoftApSecurityType.WPA3_SAE,
@@ -1272,6 +1286,9 @@
             self.dut, wutils.WifiEnums.CountryCode.US)
         asserts.skip_if(not is_supported, "BridgedAp is not supported in {}"
                         .format(wutils.WifiEnums.CountryCode.US))
+
+        # Simulate the unplugged scenario
+        self.dut.adb.shell("cmd battery unplug")
         # Enable BridgedAp with "Extend compatibility set to ON".
         self.enable_bridged_ap(self.dut,
                                WifiEnums.SoftApSecurityType.WPA3_SAE,
@@ -1314,6 +1331,9 @@
             self.dut, wutils.WifiEnums.CountryCode.US)
         asserts.skip_if(not is_supported, "BridgedAp is not supported in {}"
                         .format(wutils.WifiEnums.CountryCode.US))
+
+        # Simulate the unplugged scenario
+        self.dut.adb.shell("cmd battery unplug")
         # Enable BridgedAp with "Extend compatibility set to ON".
         self.enable_bridged_ap(self.dut,
                                WifiEnums.SoftApSecurityType.WPA3_SAE,
diff --git a/acts_tests/tests/google/wifi/aware/functional/DiscoveryTest.py b/acts_tests/tests/google/wifi/aware/functional/DiscoveryTest.py
index 39f009d..69dc42c 100644
--- a/acts_tests/tests/google/wifi/aware/functional/DiscoveryTest.py
+++ b/acts_tests/tests/google/wifi/aware/functional/DiscoveryTest.py
@@ -14,6 +14,7 @@
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
+import queue
 import string
 import time
 
@@ -32,6 +33,7 @@
     PAYLOAD_SIZE_MIN = 0
     PAYLOAD_SIZE_TYPICAL = 1
     PAYLOAD_SIZE_MAX = 2
+    EVENT_TIMEOUT = 3
 
     # message strings
     query_msg = "How are you doing? 你好嗎?"
@@ -1111,6 +1113,18 @@
             event["data"][aconsts.SESSION_CB_KEY_MESSAGE_AS_STRING], s_to_p_msg,
             "Message on service %s from Subscriber to Publisher "
             "not received correctly" % session_name["pub"][p_disc_id])
+        try:
+            event = p_dut.ed.pop_event(autils.decorate_event(aconsts.SESSION_CB_ON_MESSAGE_RECEIVED,
+                                             p_disc_id), self.EVENT_TIMEOUT)
+            p_dut.log.info("re-transmit message received: "
+                           + event["data"][aconsts.SESSION_CB_KEY_MESSAGE_AS_STRING])
+            asserts.assert_equal(
+                event["data"][aconsts.SESSION_CB_KEY_MESSAGE_AS_STRING], s_to_p_msg,
+                "Message on service %s from Subscriber to Publisher "
+                "not received correctly" % session_name["pub"][p_disc_id])
+        except queue.Empty:
+            p_dut.log.info("no re-transmit message")
+
         peer_id_on_pub = event["data"][aconsts.SESSION_CB_KEY_PEER_ID]
 
         # Message send from Publisher to Subscriber
@@ -1129,6 +1143,17 @@
             event["data"][aconsts.SESSION_CB_KEY_MESSAGE_AS_STRING], p_to_s_msg,
             "Message on service %s from Publisher to Subscriber"
             "not received correctly" % session_name["sub"][s_disc_id])
+        try:
+            event = s_dut.ed.pop_event(autils.decorate_event(aconsts.SESSION_CB_ON_MESSAGE_RECEIVED,
+                                                             s_disc_id), self.EVENT_TIMEOUT)
+            s_dut.log.info("re-transmit message received: "
+                           + event["data"][aconsts.SESSION_CB_KEY_MESSAGE_AS_STRING])
+            asserts.assert_equal(
+                event["data"][aconsts.SESSION_CB_KEY_MESSAGE_AS_STRING], p_to_s_msg,
+                "Message on service %s from Publisher to Subscriber"
+                "not received correctly" % session_name["sub"][s_disc_id])
+        except queue.Empty:
+            s_dut.log.info("no re-transmit message")
 
     def run_multiple_concurrent_services_same_name_diff_ssi(self, type_x, type_y):
         """Validate same service name with multiple service specific info on publisher
diff --git a/acts_tests/tests/google/wifi/rtt/functional/RangeAwareTest.py b/acts_tests/tests/google/wifi/rtt/functional/RangeAwareTest.py
index 1051fc4..84ad88e 100644
--- a/acts_tests/tests/google/wifi/rtt/functional/RangeAwareTest.py
+++ b/acts_tests/tests/google/wifi/rtt/functional/RangeAwareTest.py
@@ -339,19 +339,6 @@
 
     #############################################################################
 
-    @test_tracker_info(uuid="9e4e7ab4-2254-498c-9788-21e15ed9a370")
-    def test_rtt_oob_discovery_one_way(self):
-        """Perform RTT between 2 Wi-Fi Aware devices. Use out-of-band discovery
-        to communicate the MAC addresses to the peer. Test one-direction RTT only.
-        Functionality test: Only evaluate success rate.
-        """
-        rtt_results = self.run_rtt_oob_discovery_set(
-            do_both_directions=False,
-            iter_count=self.NUM_ITER,
-            time_between_iterations=self.TIME_BETWEEN_ITERATIONS,
-            time_between_roles=self.TIME_BETWEEN_ROLES)
-        self.verify_results(rtt_results)
-
     @test_tracker_info(uuid="22edba77-eeb2-43ee-875a-84437550ad84")
     def test_rtt_oob_discovery_both_ways(self):
         """Perform RTT between 2 Wi-Fi Aware devices. Use out-of-band discovery
@@ -393,19 +380,6 @@
             time_between_roles=self.TIME_BETWEEN_ROLES)
         self.verify_results(rtt_results1, rtt_results2)
 
-    @test_tracker_info(uuid="3a1d19a2-7241-49e0-aaf2-0a1da4c29783")
-    def test_rtt_oob_discovery_one_way_with_accuracy_evaluation(self):
-        """Perform RTT between 2 Wi-Fi Aware devices. Use out-of-band discovery
-        to communicate the MAC addresses to the peer. Test one-direction RTT only.
-        Performance test: evaluate success rate and accuracy.
-        """
-        rtt_results = self.run_rtt_oob_discovery_set(
-            do_both_directions=False,
-            iter_count=self.NUM_ITER,
-            time_between_iterations=self.TIME_BETWEEN_ITERATIONS,
-            time_between_roles=self.TIME_BETWEEN_ROLES)
-        self.verify_results(rtt_results, accuracy_evaluation=True)
-
     @test_tracker_info(uuid="82f954a5-c0ec-4bc6-8940-3b72199328ac")
     def test_rtt_oob_discovery_both_ways_with_accuracy_evaluation(self):
         """Perform RTT between 2 Wi-Fi Aware devices. Use out-of-band discovery