Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 1 | /* |
| 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 Hawkey | 7d17629 | 2014-12-19 14:13:30 -0700 | [diff] [blame] | 17 | syntax = "proto2"; |
| 18 | |
| 19 | package launcher_backup; |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 20 | |
Adam Cohen | cb76741 | 2015-07-31 10:58:44 -0700 | [diff] [blame] | 21 | option javanano_use_deprecated_package = true; |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 22 | option java_package = "com.android.launcher3.backup"; |
| 23 | option java_outer_classname = "BackupProtos"; |
| 24 | |
| 25 | message Key { |
| 26 | enum Type { |
| 27 | FAVORITE = 1; |
| 28 | SCREEN = 2; |
Chris Wren | 22e130d | 2013-09-23 18:25:57 -0400 | [diff] [blame] | 29 | ICON = 3; |
Chris Wren | fd13c71 | 2013-09-27 15:45:19 -0400 | [diff] [blame] | 30 | WIDGET = 4; |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 31 | } |
| 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 | |
| 38 | message CheckedMessage { |
| 39 | required bytes payload = 1; |
| 40 | required int64 checksum = 2; |
| 41 | } |
| 42 | |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 43 | message 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 Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 50 | message Journal { |
| 51 | required int32 app_version = 1; |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 52 | |
| 53 | // Time when the backup was created |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 54 | required int64 t = 2; |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 55 | |
| 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 Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 59 | optional int64 bytes = 3; |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 60 | |
| 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 Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 64 | optional int32 rows = 4; |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 65 | |
| 66 | // Valid keys for this state |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 67 | repeated Key key = 5; |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 68 | |
| 69 | // Backup format version. |
| 70 | optional int32 backup_version = 6 [default = 1]; |
| 71 | |
| 72 | optional DeviceProfieData profile = 7; |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 73 | } |
| 74 | |
| 75 | message Favorite { |
Sunny Goyal | bb3b02f | 2015-01-15 12:00:14 -0800 | [diff] [blame] | 76 | // Type of the app, this target represents |
| 77 | enum TargetType { |
| 78 | TARGET_NONE = 0; |
| 79 | TARGET_PHONE = 1; |
| 80 | TARGET_MESSENGER = 2; |
| 81 | TARGET_EMAIL = 3; |
| 82 | TARGET_BROWSER = 4; |
| 83 | TARGET_GALLERY = 5; |
| 84 | TARGET_CAMERA = 6; |
| 85 | } |
| 86 | |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 87 | required int64 id = 1; |
| 88 | required int32 itemType = 2; |
| 89 | optional string title = 3; |
| 90 | optional int32 container = 4; |
| 91 | optional int32 screen = 5; |
| 92 | optional int32 cellX = 6; |
| 93 | optional int32 cellY = 7; |
| 94 | optional int32 spanX = 8; |
| 95 | optional int32 spanY = 9; |
| 96 | optional int32 displayMode = 10; |
| 97 | optional int32 appWidgetId = 11; |
| 98 | optional string appWidgetProvider = 12; |
| 99 | optional string intent = 13; |
| 100 | optional string uri = 14; |
| 101 | optional int32 iconType = 15; |
| 102 | optional string iconPackage = 16; |
| 103 | optional string iconResource = 17; |
| 104 | optional bytes icon = 18; |
Sunny Goyal | 107ea63 | 2015-07-20 12:59:39 -0700 | [diff] [blame] | 105 | |
| 106 | // Added in backup version 4 |
Sunny Goyal | bb3b02f | 2015-01-15 12:00:14 -0800 | [diff] [blame] | 107 | optional TargetType targetType = 19 [default = TARGET_NONE]; |
Sunny Goyal | 107ea63 | 2015-07-20 12:59:39 -0700 | [diff] [blame] | 108 | optional int32 rank = 20; |
Sunny Goyal | 3a30cfe | 2015-07-16 17:27:43 -0700 | [diff] [blame] | 109 | } |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 110 | |
| 111 | message Screen { |
| 112 | required int64 id = 1; |
| 113 | optional int32 rank = 2; |
Sunny Goyal | 3a30cfe | 2015-07-16 17:27:43 -0700 | [diff] [blame] | 114 | } |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 115 | |
| 116 | message Resource { |
Chris Wren | fd13c71 | 2013-09-27 15:45:19 -0400 | [diff] [blame] | 117 | required int32 dpi = 1; |
| 118 | required bytes data = 2; |
Sunny Goyal | 3a30cfe | 2015-07-16 17:27:43 -0700 | [diff] [blame] | 119 | } |
Chris Wren | fd13c71 | 2013-09-27 15:45:19 -0400 | [diff] [blame] | 120 | |
| 121 | message Widget { |
| 122 | required string provider = 1; |
| 123 | optional string label = 2; |
| 124 | optional bool configure = 3; |
| 125 | optional Resource icon = 4; |
| 126 | optional Resource preview = 5; |
Sunny Goyal | 3a30cfe | 2015-07-16 17:27:43 -0700 | [diff] [blame] | 127 | |
Sunny Goyal | 107ea63 | 2015-07-20 12:59:39 -0700 | [diff] [blame] | 128 | // Added in backup version 3 |
Sunny Goyal | 3a30cfe | 2015-07-16 17:27:43 -0700 | [diff] [blame] | 129 | // Assume that a widget is resizable upto 2x2 if no data is available |
| 130 | optional int32 minSpanX = 6 [default = 2]; |
| 131 | optional int32 minSpanY = 7 [default = 2]; |
| 132 | } |