summaryrefslogtreecommitdiff
path: root/core/proto/android/server/notificationhistory.proto
blob: 9896ba57b2104f8f51b210ed32008dfe27956525 (plain)
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
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto2";
package com.android.server.notification;

option java_multiple_files = true;

import "frameworks/base/core/proto/android/privacy.proto";

// On disk data store for historical notifications
message NotificationHistoryProto {
  message StringPool {
    optional int32 size = 1;
    repeated string strings = 2;
  }

  message Notification {
    // The package that posted the notification
    optional string package = 1;
    // package_index contains the index + 1 of the package name in the string pool
    optional int32 package_index = 2;

    // The name of the NotificationChannel this notification was posted to
    optional string channel_name = 3 [(.android.privacy).dest = DEST_EXPLICIT];
    // channel_name_index contains the index + 1 of the channel name in the string pool
    optional int32 channel_name_index = 4;

    // The id of the NotificationChannel this notification was posted to
    optional string channel_id = 5;
    // channel_id_index contains the index + 1 of the channel id in the string pool
    optional int32 channel_id_index = 6;

    // The uid of the package that posted the notification
    optional int32 uid = 7;
    // The user id that the notification was posted to
    optional int32 user_id = 8;
    // The time at which the notification was posted
    optional int64 posted_time_ms = 9;
    // The title of the notification
    optional string title = 10 [(.android.privacy).dest = DEST_EXPLICIT];
    // The text of the notification
    optional string text = 11 [(.android.privacy).dest = DEST_EXPLICIT];
    // The small icon of the notification
    optional Icon icon = 12;

    // The conversation id, if any, that this notification belongs to
    optional string conversation_id = 13;
    // conversation_id_index contains the index + 1 of the conversation id in the string pool
    optional int32 conversation_id_index = 14;

    // Matches the constants of android.graphics.drawable.Icon
    enum ImageTypeEnum {
      TYPE_UNKNOWN = 0;
      TYPE_BITMAP = 1;
      TYPE_RESOURCE = 2;
      TYPE_DATA = 3;
      TYPE_URI = 4;
      TYPE_ADAPTIVE_BITMAP = 5;
    }

    message Icon {
      optional ImageTypeEnum image_type = 1;
      optional string image_bitmap_filename = 2;
      optional int32 image_resource_id = 3;
      optional string image_resource_id_package = 4;
      optional bytes image_data = 5;
      optional int32 image_data_length = 6;
      optional int32 image_data_offset = 7;
      optional string image_uri = 8;
    }
  }

  // Pool of strings to save space
  optional StringPool string_pool = 1;
  // Versioning fields
  optional int32 major_version = 2;

  // List of historical notifications
  repeated Notification notification = 3;
}