blob: e1af696d4c6b64926537bddf4d74ab99c1840d99 [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
Adam Cohencb767412015-07-31 10:58:44 -070021option javanano_use_deprecated_package = true;
Chris Wren1ada10d2013-09-13 18:01:38 -040022option java_package = "com.android.launcher3.backup";
23option java_outer_classname = "BackupProtos";
24
25message Key {
26 enum Type {
27 FAVORITE = 1;
28 SCREEN = 2;
Chris Wren22e130d2013-09-23 18:25:57 -040029 ICON = 3;
Chris Wrenfd13c712013-09-27 15:45:19 -040030 WIDGET = 4;
Chris Wren1ada10d2013-09-13 18:01:38 -040031 }
32 required Type type = 1;
33 optional string name = 2; // keep this short
34 optional int64 id = 3;
35 optional int64 checksum = 4;
36}
37
38message CheckedMessage {
39 required bytes payload = 1;
40 required int64 checksum = 2;
41}
42
Sunny Goyal33d44382014-10-16 09:24:19 -070043message DeviceProfieData {
44 required float desktop_rows = 1;
45 required float desktop_cols = 2;
46 required float hotseat_count = 3;
47 required int32 allapps_rank = 4;
48}
49
Chris Wren1ada10d2013-09-13 18:01:38 -040050message Journal {
51 required int32 app_version = 1;
Sunny Goyal33d44382014-10-16 09:24:19 -070052
53 // Time when the backup was created
Chris Wren1ada10d2013-09-13 18:01:38 -040054 required int64 t = 2;
Sunny Goyal33d44382014-10-16 09:24:19 -070055
56 // Total bytes written during the last backup
57 // OBSOLETE: A state may contain entries which are already present in the backup
58 // and were not written in the last backup
Chris Wren1ada10d2013-09-13 18:01:38 -040059 optional int64 bytes = 3;
Sunny Goyal33d44382014-10-16 09:24:19 -070060
61 // Total entries written during the last backup
62 // OBSOLETE: A state may contain entries which are already present in the backup
63 // and were not written in the last backup
Chris Wren1ada10d2013-09-13 18:01:38 -040064 optional int32 rows = 4;
Sunny Goyal33d44382014-10-16 09:24:19 -070065
66 // Valid keys for this state
Chris Wren1ada10d2013-09-13 18:01:38 -040067 repeated Key key = 5;
Sunny Goyal33d44382014-10-16 09:24:19 -070068
69 // Backup format version.
70 optional int32 backup_version = 6 [default = 1];
71
72 optional DeviceProfieData profile = 7;
Chris Wren1ada10d2013-09-13 18:01:38 -040073}
74
75message Favorite {
76 required int64 id = 1;
77 required int32 itemType = 2;
78 optional string title = 3;
79 optional int32 container = 4;
80 optional int32 screen = 5;
81 optional int32 cellX = 6;
82 optional int32 cellY = 7;
83 optional int32 spanX = 8;
84 optional int32 spanY = 9;
85 optional int32 displayMode = 10;
86 optional int32 appWidgetId = 11;
87 optional string appWidgetProvider = 12;
88 optional string intent = 13;
89 optional string uri = 14;
90 optional int32 iconType = 15;
91 optional string iconPackage = 16;
92 optional string iconResource = 17;
93 optional bytes icon = 18;
Sunny Goyal249a5102015-07-16 17:27:43 -070094}
Chris Wren1ada10d2013-09-13 18:01:38 -040095
96message Screen {
97 required int64 id = 1;
98 optional int32 rank = 2;
Sunny Goyal249a5102015-07-16 17:27:43 -070099}
Chris Wren1ada10d2013-09-13 18:01:38 -0400100
101message Resource {
Chris Wrenfd13c712013-09-27 15:45:19 -0400102 required int32 dpi = 1;
103 required bytes data = 2;
Sunny Goyal249a5102015-07-16 17:27:43 -0700104}
Chris Wrenfd13c712013-09-27 15:45:19 -0400105
106message Widget {
107 required string provider = 1;
108 optional string label = 2;
109 optional bool configure = 3;
110 optional Resource icon = 4;
111 optional Resource preview = 5;
Sunny Goyal249a5102015-07-16 17:27:43 -0700112
113 // Assume that a widget is resizable upto 2x2 if no data is available
114 optional int32 minSpanX = 6 [default = 2];
115 optional int32 minSpanY = 7 [default = 2];
116}