Skip to content

Conversation

@mykola-mokhnach
Copy link
Contributor

* @returns {boolean} True if a new recording has successfully started.
* @throws {Error} If recording has failed to start or is not supported on the device under test.
*/
commands.mobileStartMediaProjectionRecording = async function mobileStartMediaProjectionRecording (options = {}) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"mediaProjectionRecording" is an awful long string to have inside names everywhere :-(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could use mpRecording, not sure if it would be readable enough though

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe for the internal code mp is fine, and keep the "mediaProjection" for the user-facing strings? not sure if that's easy to do.

it's not a huge deal, i just hate reading entire sentences as variable names :-)

}

async isRunning () {
const stdout = await this.adb.shell(['dumpsys', 'activity', 'services']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like the result can be filtered by the package name/activity:

adb dumpsys activity services RECORDING_SERVICE_NAME

I haven't verified well, but potentially does this have slightly better performance rather than getting all services...?

Empty result:

ACTIVITY MANAGER SERVICES (dumpsys activity services)
  (nothing)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

@mykola-mokhnach mykola-mokhnach merged commit 501ac72 into appium:master Jun 21, 2022
@mykola-mokhnach mykola-mokhnach deleted the media_proj branch June 21, 2022 07:20
github-actions bot pushed a commit that referenced this pull request Jun 21, 2022
# [5.2.0](v5.1.0...v5.2.0) (2022-06-21)

### Features

* Add mobile wrappers for media-projection-based screen recording ([#748](#748)) ([501ac72](501ac72))
@github-actions
Copy link

🎉 This PR is included in version 5.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants