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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Next MinVersion: 24
module arc.mojom;
import "components/arc/mojom/bitmap.mojom";
import "components/arc/mojom/gfx.mojom";
// These values must be matched with the NOTIFICATION_EVENT_* constants in
// com.android.server.ArcNotificationListenerService.
[Extensible]
enum ArcNotificationEvent {
BODY_CLICKED = 0,
CLOSED = 1,
// Deprecated: Five button events
DEPRECATED_BUTTON_1_CLICKED = 2,
DEPRECATED_BUTTON_2_CLICKED = 3,
DEPRECATED_BUTTON_3_CLICKED = 4,
DEPRECATED_BUTTON_4_CLICKED = 5,
DEPRECATED_BUTTON_5_CLICKED = 6,
// expand/collapse the bundled notification
[MinVersion=10] TOGGLE_EXPANSION = 7,
};
[Extensible]
enum ArcNotificationType {
SIMPLE = 0,
DEPRECATED_IMAGE = 1,
DEPRECATED_PROGRESS = 2,
DEPRECATED_LIST = 3,
BUNDLED = 4,
};
// These values are corresponding to the priorities or importance of Android
// notification.
[Extensible]
enum ArcNotificationPriority {
NONE = -3,
MIN = -2,
LOW = -1,
DEFAULT = 0,
HIGH = 1,
MAX = 2,
};
// DEPRECATED
struct DeprecatedArcNotificationButton {
// Title
string label;
};
[Extensible, MinVersion=10]
enum ArcNotificationExpandState {
FIXED_SIZE = 0,
COLLAPSED = 1,
EXPANDED = 2,
};
[Extensible, MinVersion=12]
enum ArcNotificationRemoteInputState {
CLOSED = 0,
OPENED = 1,
};
// These values represent what shows in an ARC custom notification.
[Extensible, MinVersion=11]
enum ArcNotificationShownContents {
// The normal notification contents are shown.
CONTENTS_SHOWN = 0,
// The notification settings view is shown.
SETTINGS_SHOWN = 1,
// The notification snooze settings view is shown.
[MinVersion=17]
SNOOZE_SHOWN = 2,
};
// Flag for various feature of ARC notifications.
[MinVersion=17]
struct ArcNotificationFlags {
// Bits for features.
const uint32 SUPPORT_SNOOZE = 1; // 1 << 0
// Bit-masked value.
uint32 value;
};
struct ArcNotificationData {
// Identifier of notification
string key;
// Type of notification
ArcNotificationType type;
// Body message of notification
string message;
// Title of notification
string title;
// DEPRECATED: Mimetype of |icon_data|
string? deprecated_icon_mimetype;
// DEPRECATED: Binary data of the icon
array<uint8>? deprecated_icon_data;
// Priority of notification
ArcNotificationPriority priority;
// Timestamp related to the notification
int64 time;
// DEPRECATED: The current value of progress, must be [0, progress_max].
int32 deprecated_progress_current;
// DEPRECATED: The maximum value of progress.
int32 deprecated_progress_max;
// DEPRECATED: Action buttons
array<DeprecatedArcNotificationButton>? deprecated_buttons;
// Flag if the notification has FLAG_NO_CLEAR.
[MinVersion=1]
bool no_clear;
// Flag if the notification has FLAG_ONGOING_EVENT.
[MinVersion=1]
bool ongoing_event;
// DEPRECATED: Subtexts for list notifications.
[MinVersion=3]
array<string>? deprecated_texts;
// DEPRECATED: Image for image notifications.
[MinVersion=3]
ArcBitmap? deprecated_big_picture;
// DEPRECATED: Flag if a notification is a custom notification backed by a
// notification surface.
[MinVersion=5]
bool deprecated_use_custom_notification;
[MinVersion=6]
ArcBitmap? small_icon;
// A snapshot image to show before the notification window is created.
[MinVersion=7]
ArcBitmap? snapshot_image;
[MinVersion=7]
float snapshot_image_scale;
// Accessibility text
[MinVersion=8]
string? accessible_name;
// Flag if the notification is expandable
[MinVersion=10]
ArcNotificationExpandState expand_state;
// Flag for what shows in a notification.
[MinVersion=11]
ArcNotificationShownContents shown_contents;
[MinVersion=12]
ArcNotificationRemoteInputState remote_input_state;
// Indicates a rect for which Android wants to handle swipe events for by
// itself. The coordinates in this Rect are in Android pixels and represent
// a sub-rectangle of the notification, with the origin being the top left
// of the notification.
[MinVersion=14]
Rect? swipe_input_rect;
[MinVersion=15]
string? package_name;
[MinVersion=17]
ArcNotificationFlags? flags;
[MinVersion=21]
bool hidden_on_lock_screen;
[MinVersion=21]
ArcBitmap? snapshot_image_public;
[MinVersion=23]
bool is_media_notification;
};
[MinVersion=18]
struct ArcDoNotDisturbStatus {
bool enabled;
};
[MinVersion=21]
struct ArcNotificationUserActionData {
// Unique action id for this user action.
uint32 action_id;
// Notification key of top-level notification which contains the notification
// which is initiating this action.
string top_level_notification_key;
// True if the task should be executed on the unlocked state.
bool defer_until_unlock;
// True if the notification view should be focused after unlock. This is
// effective only when |defer_until_unlock| is true.
bool to_be_focused_after_unlock;
};
[MinVersion=21]
struct ArcLockScreenNotificationSetting {
// Flag whether to show the notifications on the lock screen.
bool show_notification;
// Flag whether to show the private content on the lock screen.
bool show_private_notification;
};
[MinVersion=22]
struct NotificationConfiguration {
// Flag to enable notification expansion animations on arc.
// See b/35786193.
bool expansion_animation;
};
// Next Method ID: 11
interface NotificationsHost {
// Set the Do-Not-Disturb status on Chrome side from Android side.
[MinVersion=18]
OnDoNotDisturbStatusUpdated@7(ArcDoNotDisturbStatus status);
// Tells the Chrome that a notification is posted (created or updated) on
// Android. If you know that the notification exists, please consider to use
// OnNotificationUpdate instead.
// |notification_data| is the data of notification (id, texts, icon and ...).
OnNotificationPosted@0(ArcNotificationData notification_data);
// Notifies that a notification is removed on Android.
// |key| is the identifier of the notification.
OnNotificationRemoved@1(string key);
[MinVersion=13]
// Notifies that an existing notiication is updated on Android.
OnNotificationUpdated@5(ArcNotificationData notification_data);
[MinVersion=16]
// Opens the Chrome OS message center.
OpenMessageCenter@6();
[MinVersion=20]
// Closes the Chrome OS message center.
CloseMessageCenter@8();
[MinVersion=21]
// Processes the user action initiated from Android side on Chrome side.
ProcessUserAction@9(ArcNotificationUserActionData data);
[MinVersion=21]
// Sets the lock screen setting on Chrome side from Android side. Usually
// invoked when the setting on Android side is chagned.
OnLockScreenSettingUpdated@10(ArcLockScreenNotificationSetting setting);
};
// Next Method ID: 13
// TODO(lhchavez): Migrate all request/response messages to Mojo.
interface NotificationsInstance {
// DEPRECATED: Please use Init@5 instead.
InitDeprecated@0(NotificationsHost host_ptr);
// Establishes full-duplex communication with the host.
[MinVersion=14] Init@5(NotificationsHost host_ptr) => ();
// Sends an event from Chrome notification UI to Android.
// |event| is a type of occured event.
SendNotificationEventToAndroid@1(string key, ArcNotificationEvent event);
// Requests to Android side to create the notification window.
// |key| is the identifier of the notification which is generated by Android
// side.
[MinVersion=7]
CreateNotificationWindow@2(string key);
// Requests to Android side to close the notification window.
// |key| is the identifier of the notification which is generated by Android
// side.
[MinVersion=7]
CloseNotificationWindow@3(string key);
// Requests to Android side to open notification settings.
// |key| is the identifier of the notification which is generated by Android
// side.
[MinVersion=9]
OpenNotificationSettings@4(string key);
// Requests to Android side to open snooze settings.
// |key| is the identifier of the notification which is generated by Android
// side.
[MinVersion=17]
OpenNotificationSnoozeSettings@6(string key);
// Sets the Do-Not-Disturb status on Android side from Chrome side.
[MinVersion=18]
SetDoNotDisturbStatusOnAndroid@7(ArcDoNotDisturbStatus status);
// Cancels the current press operation even during touching the view. This
// should be called when the on-going gesture is recognized not as a normal
// touch event but as a scroll event, and the on-going touch events should be
// cancelled.
[MinVersion=19]
CancelPress@8(string key);
// Performs the user action being deferred in Android.
[MinVersion=21]
PerformDeferredUserAction@9(uint32 action_id);
// Cancels the user action being deferred in Android.
[MinVersion=21]
CancelDeferredUserAction@10(uint32 action_id);
// Sets the lock screen notification setting on Android side from Chrome side.
[MinVersion=21]
SetLockScreenSettingOnAndroid@11(ArcLockScreenNotificationSetting setting);
// Set configuration variables for notifications.
[MinVersion=22]
SetNotificationConfiguration@12(NotificationConfiguration configuration);
};
|