-
Notifications
You must be signed in to change notification settings - Fork 0
/
IncomingCall-Flow.bike
88 lines (88 loc) · 3.71 KB
/
IncomingCall-Flow.bike
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
</head>
<body>
<ul id="0oLfVMGY">
<li id="1RA">
<p>TLDR: we make WatchApp start vibration *only* if it’s open not by User. To tell opening by User from opening by System apart, we can employ either extra command from the companion or maintain some internal state. Relying on extra command from companion looks coherent with the fact that we already send openAppFailed message to WatchApp. So we could replace it with openAppResult that would hold cover both success and failure scenarios.</p>
</li>
<li id="V3c">
<p/>
</li>
<li id="u2">
<p>Incoming call is registered in Companion</p>
</li>
<li id="yr">
<p>Watch App receives the “ringing” message from Companion</p>
<ul>
<li id="lx">
<p>Watch App updates the local call state to “ringing”</p>
</li>
<li id="s5">
<p>If the Watch App is active (open):</p>
<ul>
<li id="vt">
<p>Watch App starts the vibration</p>
</li>
</ul>
</li>
<li id="hB">
<p>If Watch App is in the background:</p>
<ul>
<li id="r1">
<p>Watch app sends “openMe” message to Companion</p>
</li>
<li id="Pp">
<p>Companion sends a system command to open the app, to the watch</p>
<ul>
<li id="yhT">
<p>Companion sends message to Watch App, covering the result of the system “open watch app” command.</p>
</li>
<li id="b8">
<p>If the system command fails (e.g. because there’s activity open or Watch App' glance is visible):</p>
<ul>
<li id="AM">
<p>Watch App prompts User to open the app for incoming call</p>
</li>
<li id="mI">
<p>If User accepts the prompt to open the app:</p>
<ul>
<li id="5ba">
<p>Watch App gets open (by user), finds the “ringing” call state, and, based on that, presents “incoming call” prompt</p>
</li>
</ul>
</li>
</ul>
</li>
<li id="Ka">
<p>If the system command succeeds:</p>
<ul>
<li id="We">
<p>Watch App gets open (by system), finds the “ringing” call state, and, based on that, presents “incoming call” prompt</p>
</li>
<li id="xtT">
<p><span>(*Assuming this happens </span><strong>after</strong><span> the above*) Watch App receives the message about success of the system “open watch app” command</span></p>
<ul>
<li id="2Yd">
<p>If User did not react to the prompt</p>
<ul>
<li id="7Q6">
<p><span>Watch app </span><strong>starts vibrating</strong></p>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</body>
</html>