blob: 09330ee06266a57aa15bdaa2e6bf556de7b1eb5f [file] [log] [blame]
Chris Wren1ada10d2013-09-13 18:01:38 -04001/*
2 * Copyright (C) 2013 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
Dave Hawkey7d176292014-12-19 14:13:30 -070017syntax = "proto2";
18
19package launcher_backup;
Chris Wren1ada10d2013-09-13 18:01:38 -040020
21option java_package = "com.android.launcher3.backup";
22option java_outer_classname = "BackupProtos";
23
24message Key {
25 enum Type {
26 FAVORITE = 1;
27 SCREEN = 2;
Chris Wren22e130d2013-09-23 18:25:57 -040028 ICON = 3;
Chris Wrenfd13c712013-09-27 15:45:19 -040029 WIDGET = 4;
Chris Wren1ada10d2013-09-13 18:01:38 -040030 }
31 required Type type = 1;
32 optional string name = 2; // keep this short
33 optional int64 id = 3;
34 optional int64 checksum = 4;
35}
36
37message CheckedMessage {
38 required bytes payload = 1;
39 required int64 checksum = 2;
40}
41
Sunny Goyal33d44382014-10-16 09:24:19 -070042message DeviceProfieData {
43 required float desktop_rows = 1;
44 required float desktop_cols = 2;
45 required float hotseat_count = 3;
46 required int32 allapps_rank = 4;
47}
48
Chris Wren1ada10d2013-09-13 18:01:38 -040049message Journal {
50 required int32 app_version = 1;
Sunny Goyal33d44382014-10-16 09:24:19 -070051
52 // Time when the backup was created
Chris Wren1ada10d2013-09-13 18:01:38 -040053 required int64 t = 2;
Sunny Goyal33d44382014-10-16 09:24:19 -070054
55 // Total bytes written during the last backup
56 // OBSOLETE: A state may contain entries which are already present in the backup
57 // and were not written in the last backup
Chris Wren1ada10d2013-09-13 18:01:38 -040058 optional int64 bytes = 3;
Sunny Goyal33d44382014-10-16 09:24:19 -070059
60 // Total entries written during the last backup
61 // OBSOLETE: A state may contain entries which are already present in the backup
62 // and were not written in the last backup
Chris Wren1ada10d2013-09-13 18:01:38 -040063 optional int32 rows = 4;
Sunny Goyal33d44382014-10-16 09:24:19 -070064
65 // Valid keys for this state
Chris Wren1ada10d2013-09-13 18:01:38 -040066 repeated Key key = 5;
Sunny Goyal33d44382014-10-16 09:24:19 -070067
68 // Backup format version.
69 optional int32 backup_version = 6 [default = 1];
70
71 optional DeviceProfieData profile = 7;
Chris Wren1ada10d2013-09-13 18:01:38 -040072}
73
74message Favorite {
Sunny Goyalbb3b02f2015-01-15 12:00:14 -080075 // Type of the app, this target represents
76 enum TargetType {
77 TARGET_NONE = 0;
78 TARGET_PHONE = 1;
79 TARGET_MESSENGER = 2;
80 TARGET_EMAIL = 3;
81 TARGET_BROWSER = 4;
82 TARGET_GALLERY = 5;
83 TARGET_CAMERA = 6;
84 }
85
Chris Wren1ada10d2013-09-13 18:01:38 -040086 required int64 id = 1;
87 required int32 itemType = 2;
88 optional string title = 3;
89 optional int32 container = 4;
90 optional int32 screen = 5;
91 optional int32 cellX = 6;
92 optional int32 cellY = 7;
93 optional int32 spanX = 8;
94 optional int32 spanY = 9;
95 optional int32 displayMode = 10;
96 optional int32 appWidgetId = 11;
97 optional string appWidgetProvider = 12;
98 optional string intent = 13;
99 optional string uri = 14;
100 optional int32 iconType = 15;
101 optional string iconPackage = 16;
102 optional string iconResource = 17;
103 optional bytes icon = 18;
Sunny Goyalbb3b02f2015-01-15 12:00:14 -0800104 optional TargetType targetType = 19 [default = TARGET_NONE];
Chris Wren1ada10d2013-09-13 18:01:38 -0400105 }
106
107message Screen {
108 required int64 id = 1;
109 optional int32 rank = 2;
110 }
111
112message Resource {
Chris Wrenfd13c712013-09-27 15:45:19 -0400113 required int32 dpi = 1;
114 required bytes data = 2;
115 }
116
117message Widget {
118 required string provider = 1;
119 optional string label = 2;
120 optional bool configure = 3;
121 optional Resource icon = 4;
122 optional Resource preview = 5;
Chris Wren1ada10d2013-09-13 18:01:38 -0400123 }