| id: "do_not_disturb" |
| name: "Do Not Disturb Mode" |
| description: "Enter Do Not Disturb Mode" |
|
|
| setup_steps: { |
| adb_call: { rotate: { orientation: PORTRAIT_0 } } |
| } |
|
|
| reset_steps: { |
| adb_call: { |
| shell_command: { |
| command: ["cmd", "notification", "set_dnd", "off"] |
| } |
| } |
| } |
| reset_steps: [ |
| { adb_call: { force_stop: { package_name: "com.android.settings" } } }, |
| { adb_call: { clear_cache: { package_name: "com.android.settings" } } }, |
| { |
| adb_call: { |
| start_activity: { |
| full_activity: "com.android.settings/com.android.settings.Settings" |
| } |
| } |
| success_condition: { |
| wait_for_app_screen: { |
| app_screen: { |
| activity: "com.android.settings/com.android.settings.Settings" |
| } |
| timeout_sec: 10.0 |
| } |
| num_retries: 3 |
| } |
| } |
| ] |
|
|
| max_num_steps: 500 |
|
|
| event_sources: { |
| text_detect: { |
| expect: "\\bTurn off now\\b" |
| rect: { |
| x0: 0.1481 |
| x1: 0.8703 |
| y0: 0.1354 |
| y1: 0.1719 |
| } |
| } |
| id: 1 |
| repeatability: LAST |
| } |
| event_sources: { |
| text_detect: { |
| expect: "\\bDo Not Disturb\\b" |
| rect: { |
| x0: 0.1667 |
| x1: 0.5 |
| y0: 0.0469 |
| y1: 0.0938 |
| } |
| } |
| id: 2 |
| repeatability: UNLIMITED |
| } |
| event_sources: { |
| view_hierarchy_event: { |
| selector: '#$"zen_mode_settings_turn_off_button"[text="Turn off now"]' |
| } |
| id: 3 |
| } |
| event_sources: { |
| view_hierarchy_event: { |
| selector: '[text="Do Not Disturb"].$"TextView"' |
| properties: { |
| property_name: "bottom" |
| sign: GE |
| integer: 200 |
| } |
| } |
| id: 4 |
| } |
| event_sources: { |
| view_hierarchy_event: { |
| selector: '."android.widget.Switch"[content-desc^="Do Not Disturb"]' |
| properties: { |
| property_name: "text" |
| pattern: "On" |
| } |
| properties: { |
| property_name: "checked" |
| pattern: "true" |
| } |
| } |
| id: 5 |
| } |
| event_sources: { |
| log_event: { |
| filters: "vol.Events:I" |
| pattern: "\\bzen_mode_changed (important_interruptions|no_interruptions|alarms)\\b" |
| } |
| id: 6 |
| } |
|
|
| event_slots: { |
| reward_listener: { |
| type: OR |
| id: 10 |
| events: { |
| event: { |
| type: AND |
| events: [ |
| { id: 1 }, |
| { id: 2 } |
| ] |
| transformation: "y = 1." |
| } |
| } |
| events: { |
| event: { |
| type: AND |
| events: [ |
| { id: 3 }, |
| { id: 4 } |
| ] |
| transformation: "y = 1." |
| } |
| } |
| events: [ |
| { id: 5 }, |
| { id: 6 } |
| ] |
| transformation: "y = 1." |
| repeatability: NONE |
| } |
| episode_end_listener: { |
| events: { id: 10 } |
| transformation: "y = True" |
| } |
| } |
|
|
| command: "Help me to open the \"Do Not Disturb\" mode for my phone." |
|
|