blob: c3f27e16b52d383ef07a0937f87ef8e35c1a4d13 [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
Sunny Goyala6164c52016-01-06 14:47:13 -080021option java_package = "com.android.launcher3.backup.nano";
Chris Wren1ada10d2013-09-13 18:01:38 -040022option 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 Goyal107ea632015-07-20 12:59:39 -0700104
105 // Added in backup version 4
Sunny Goyalbb3b02f2015-01-15 12:00:14 -0800106 optional TargetType targetType = 19 [default = TARGET_NONE];
Sunny Goyal107ea632015-07-20 12:59:39 -0700107 optional int32 rank = 20;
Sunny Goyal3a30cfe2015-07-16 17:27:43 -0700108}
Chris Wren1ada10d2013-09-13 18:01:38 -0400109
110message Screen {
111 required int64 id = 1;
112 optional int32 rank = 2;
Sunny Goyal3a30cfe2015-07-16 17:27:43 -0700113}
Chris Wren1ada10d2013-09-13 18:01:38 -0400114
115message Resource {
Chris Wrenfd13c712013-09-27 15:45:19 -0400116 required int32 dpi = 1;
117 required bytes data = 2;
Sunny Goyal3a30cfe2015-07-16 17:27:43 -0700118}
Chris Wrenfd13c712013-09-27 15:45:19 -0400119
120message Widget {
121 required string provider = 1;
122 optional string label = 2;
123 optional bool configure = 3;
124 optional Resource icon = 4;
125 optional Resource preview = 5;
Sunny Goyal3a30cfe2015-07-16 17:27:43 -0700126
Sunny Goyal107ea632015-07-20 12:59:39 -0700127 // Added in backup version 3
Sunny Goyal3a30cfe2015-07-16 17:27:43 -0700128 // Assume that a widget is resizable upto 2x2 if no data is available
129 optional int32 minSpanX = 6 [default = 2];
130 optional int32 minSpanY = 7 [default = 2];
131}