1/*
2 * Copyright (C) 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto3";
18
19package android.companion;
20
21option java_multiple_files = true;
22
23// Next index: 4
24message Telecom {
25  // Next index: 6
26  message Call {
27    // UUID representing this call
28    string id = 1;
29
30    message Origin {
31      // Caller's name and/or phone number; what a user would see displayed when receiving an
32      // incoming call on the local device
33      string caller_id = 1;
34      bytes app_icon = 2;
35      CallFacilitator facilitator = 3;
36    }
37    Origin origin = 2;
38
39    enum Status {
40      UNKNOWN_STATUS = 0;
41      RINGING = 1;
42      ONGOING = 2;
43      ON_HOLD = 3;
44      RINGING_SILENCED = 4;
45      AUDIO_PROCESSING = 5;
46      RINGING_SIMULATED = 6;
47      DISCONNECTED = 7;
48      DIALING = 8;
49    }
50    Status status = 3;
51
52    repeated Control controls = 4;
53
54    enum Direction {
55      UNKNOWN_DIRECTION = 0;
56      INCOMING = 1;
57      OUTGOING = 2;
58    }
59    Direction direction = 5;
60  }
61
62  message Request {
63    message CreateAction {
64      // UUID representing this request.
65      string id = 1;
66      // URI representing the address of the intended callee.
67      string address = 2;
68      // Which facilitator should handle this call.
69      CallFacilitator facilitator = 3;
70    }
71    message ControlAction {
72      // UUID representing the call to perform the control action on
73      string id = 1;
74      // The control to perform
75      Control control = 2;
76    }
77
78    oneof action {
79      CreateAction create_action = 1;
80      ControlAction control_action = 2;
81    }
82  }
83
84  // A facilitator (namely an app) that can be directed to place calls.
85  // Next index: 3
86  message CallFacilitator {
87    // Human-readable name of the facilitator
88    string name = 1;
89    // Unique identifier for this facilitator, such as a package name.
90    string identifier = 2;
91    // Extended identifier for this facilitator.
92    string extended_identifier = 3;
93  }
94
95  enum Control {
96    UNKNOWN_CONTROL = 0;
97    ACCEPT = 1;
98    REJECT = 2;
99    SILENCE = 3;
100    MUTE = 4;
101    UNMUTE = 5;
102    END = 6;
103    PUT_ON_HOLD = 7;
104    TAKE_OFF_HOLD = 8;
105  }
106
107  // The list of active calls.
108  repeated Call calls = 1;
109  // The list of requested calls or call changes.
110  repeated Request requests = 2;
111  // The list of call facilitators that this device currently supports.
112  repeated CallFacilitator facilitators = 3;
113}
114