-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGMapsAppProfile.cpp
More file actions
42 lines (33 loc) · 1.46 KB
/
GMapsAppProfile.cpp
File metadata and controls
42 lines (33 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "stdafx.h"
#include "GMapsAppProfile.h"
#include <thread>
GMapsAppProfile::GMapsAppProfile()
{
FriendlyName = "Google Maps";
Package = "com.google.android.apps.maps";
/* Build Interactions */
TapAppInteraction *action_tap_hamburgerMenu = new TapAppInteraction("Open Hamburger Menu", 85, 111);
ActionMap.insert(std::make_pair("openHamburgerMenu", action_tap_hamburgerMenu));
TapAppInteraction *action_tap_drivingMenuAction = new TapAppInteraction("Start Driving Mode", "ref_images/gmaps_startDriving_icon.png");
ActionMap.insert(std::make_pair("startDrivingMode", action_tap_drivingMenuAction));
TapAppInteraction *action_tap_voiceInput = new TapAppInteraction("Launch Voice Input", "ref_images/gmaps_voice_icon.png");
ActionMap.insert(std::make_pair("launchVoiceInput", action_tap_voiceInput));
}
GMapsAppProfile::~GMapsAppProfile()
{
}
void GMapsAppProfile::launchApp()
{
std::string runnable_cmd = launchAppCommand();
system(runnable_cmd.c_str());
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
// Launch driving mode
AppInteraction *first_action = ActionMap["openHamburgerMenu"];
AppInteraction *second_action = ActionMap["startDrivingMode"];
AppInteraction *third_action = ActionMap["launchVoiceInput"];
first_action->launchInteraction();
std::this_thread::sleep_for(std::chrono::milliseconds(500));
second_action->launchInteraction();
std::this_thread::sleep_for(std::chrono::milliseconds(500));
third_action->launchInteraction();
}