| /* |
| * 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; |
| |
| import "frameworks/base/core/proto/android/server/enums.proto"; |
| |
| option java_multiple_files = true; |
| |
| // 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; |
| // 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; |
| // The text of the notification |
| optional string text = 11; |
| // The small icon of the notification |
| optional Icon icon = 12; |
| |
| // 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; |
| } |