Disable Android Auto pop-up on HU with adb command
BUG:314385914
Execution:
/ssddrive/udc-qpr-dev/out/host/linux-x86/catbox/android-catbox/tools/catbox-tradefed run commandAndExit catbox-functional-bluetooth-tests --{phone}serial 29171FQHN00078 --{auto}serial c4ba9d70 --mobly-host:mobly-par-file-name BTMediaIsSongPlayingTest -l VERBOSE --log-level verbose > ~/log.txt
TESTED=[test log](https://paste.googleplex.com/6497507136241664)
Merged-in: I9a83e3bf72c3bb760a160a9d03a97ac07adc9846
Change-Id: I8b84f60c187e413679c1d2fa90bf8917ed082c94
diff --git a/tests/automotive/mobly_tests/utilities/bt_utils.py b/tests/automotive/mobly_tests/utilities/bt_utils.py
index 79191ba..d0e5900 100644
--- a/tests/automotive/mobly_tests/utilities/bt_utils.py
+++ b/tests/automotive/mobly_tests/utilities/bt_utils.py
@@ -19,6 +19,7 @@
from utilities import constants
from mobly import asserts
from mobly.controllers import android_device
+from utilities.media_utils import MediaUtils
# Number of seconds for the target to stay discoverable on Bluetooth.
DISCOVERABLE_TIME = 60
@@ -32,19 +33,12 @@
self.discoverer = discoverer
self.target = target
self.target_adrr = None
+ self.media_utils = MediaUtils(self.target, self.discoverer)
- # Skip Android Auto pop-up
- # TODO @vitalidim remove this function after b/314385914 resolved
- def handle_android_auto_pop_up(self):
- logging.info('Checking for Android Auto pop-up on HU')
- if self.discoverer.mbs.isStartAndroidAutoPopUpPresent():
- logging.info('Android Auto pop-up is present on HU')
- logging.info('Click on <NOT NOW> button on HU')
- self.discoverer.mbs.skipStartAndroidAutoPopUp()
- asserts.assert_false(self.discoverer.mbs.isStartAndroidAutoPopUpPresent(),
- 'Android Auto pop-up should be closed')
- else:
- logging.info('Android Auto pop-up is not present on HU')
+ # Disable Android Auto pop-up on HU
+ def disable_android_auto_popup_on_hu(self):
+ logging.info('Disable Android Auto pop-up on HU with adb')
+ self.media_utils.execute_shell_on_hu_device(constants.DISABLE_ANDROID_AUTO_POP_UP)
# Skip Assistant pop-up
# TODO @vitalidim remove this function after b/314386661 resolved
@@ -86,6 +80,7 @@
logging.info('Enabling Bluetooth on both devices')
self.discoverer.mbs.btEnable()
self.target.mbs.btEnable()
+ self.disable_android_auto_popup_on_hu()
logging.info('Setting devices to be discoverable')
self.target.mbs.btBecomeDiscoverable(DISCOVERABLE_TIME)
self.target.mbs.btStartAutoAcceptIncomingPairRequest()
@@ -103,7 +98,6 @@
'Failed to pair the target device %s over Bluetooth.' %
target_address)
time.sleep(constants.DEFAULT_WAIT_TIME_FIVE_SECS)
- self.handle_android_auto_pop_up()
self.handle_assistant_pop_up()
def press_allow_on_device(self):
diff --git a/tests/automotive/mobly_tests/utilities/constants.py b/tests/automotive/mobly_tests/utilities/constants.py
index 377094b..9551497 100644
--- a/tests/automotive/mobly_tests/utilities/constants.py
+++ b/tests/automotive/mobly_tests/utilities/constants.py
@@ -44,6 +44,7 @@
+ ' -a android.intent.action.VIEW com.google.android.contacts'
)
PATH_TO_CONTACTS_VCF_FILE = 'platform_testing/tests/automotive/mobly_tests/utils/contacts_test.vcf'
+DISABLE_ANDROID_AUTO_POP_UP = "pm disable --user 10 com.google.android.embedded.projection"
# Should be kept in sync with BluetoothProfile.java
BT_PROFILE_CONSTANTS = {