google / mobly

E2E test framework for tests with complex environment requirements.
https://github.com/google/mobly
Apache License 2.0
646 stars 179 forks source link

Always operate on the current user in `snippet_client`. #647

Closed xpconanfan closed 5 years ago

xpconanfan commented 5 years ago

It does not make sense to attempt to launch snippet in a non-active user. So we should always do package check and snippet launch in the context of the current user.


This change is Reviewable

xpconanfan commented 5 years ago

Unfortunately cmds like pm list package defaults to user 0 instead of the current user... Hence we get errors like "snippet not installed" when attempting to launch on a device whose current user is not user 0..

winterfroststrom commented 5 years ago

Can you make sure this works on a variety of devices?

I've seen issues on some devices where user id doesn't work properly

xpconanfan commented 5 years ago

Yes we've tried on lower API versions and Auto devices. Do you have specific device models that we should try on?

winterfroststrom commented 5 years ago

the devices I thinking about are android go devices

xpconanfan commented 5 years ago

Tried both running the adb cmd directly and running the snippet client within a test on Android Go. Seems fine.