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 | |
| 17 | package launcher_backup; |
| 18 | |
| 19 | option java_package = "com.android.launcher3.backup"; |
| 20 | option java_outer_classname = "BackupProtos"; |
| 21 | |
| 22 | message Key { |
| 23 | enum Type { |
| 24 | FAVORITE = 1; |
| 25 | SCREEN = 2; |
Chris Wren | 22e130d | 2013-09-23 18:25:57 -0400 | [diff] [blame] | 26 | ICON = 3; |
Chris Wren | fd13c71 | 2013-09-27 15:45:19 -0400 | [diff] [blame] | 27 | WIDGET = 4; |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 28 | } |
| 29 | required Type type = 1; |
| 30 | optional string name = 2; // keep this short |
| 31 | optional int64 id = 3; |
| 32 | optional int64 checksum = 4; |
| 33 | } |
| 34 | |
| 35 | message CheckedMessage { |
| 36 | required bytes payload = 1; |
| 37 | required int64 checksum = 2; |
| 38 | } |
| 39 | |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 40 | message DeviceProfieData { |
| 41 | required float desktop_rows = 1; |
| 42 | required float desktop_cols = 2; |
| 43 | required float hotseat_count = 3; |
| 44 | required int32 allapps_rank = 4; |
| 45 | } |
| 46 | |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 47 | message Journal { |
| 48 | required int32 app_version = 1; |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 49 | |
| 50 | // Time when the backup was created |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 51 | required int64 t = 2; |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 52 | |
| 53 | // Total bytes written during the last backup |
| 54 | // OBSOLETE: A state may contain entries which are already present in the backup |
| 55 | // and were not written in the last backup |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 56 | optional int64 bytes = 3; |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 57 | |
| 58 | // Total entries written during the last backup |
| 59 | // OBSOLETE: A state may contain entries which are already present in the backup |
| 60 | // and were not written in the last backup |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 61 | optional int32 rows = 4; |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 62 | |
| 63 | // Valid keys for this state |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 64 | repeated Key key = 5; |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 65 | |
| 66 | // Backup format version. |
| 67 | optional int32 backup_version = 6 [default = 1]; |
| 68 | |
| 69 | optional DeviceProfieData profile = 7; |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 70 | } |
| 71 | |
| 72 | message Favorite { |
| 73 | required int64 id = 1; |
| 74 | required int32 itemType = 2; |
| 75 | optional string title = 3; |
| 76 | optional int32 container = 4; |
| 77 | optional int32 screen = 5; |
| 78 | optional int32 cellX = 6; |
| 79 | optional int32 cellY = 7; |
| 80 | optional int32 spanX = 8; |
| 81 | optional int32 spanY = 9; |
| 82 | optional int32 displayMode = 10; |
| 83 | optional int32 appWidgetId = 11; |
| 84 | optional string appWidgetProvider = 12; |
| 85 | optional string intent = 13; |
| 86 | optional string uri = 14; |
| 87 | optional int32 iconType = 15; |
| 88 | optional string iconPackage = 16; |
| 89 | optional string iconResource = 17; |
| 90 | optional bytes icon = 18; |
| 91 | } |
| 92 | |
| 93 | message Screen { |
| 94 | required int64 id = 1; |
| 95 | optional int32 rank = 2; |
| 96 | } |
| 97 | |
| 98 | message Resource { |
Chris Wren | fd13c71 | 2013-09-27 15:45:19 -0400 | [diff] [blame] | 99 | required int32 dpi = 1; |
| 100 | required bytes data = 2; |
| 101 | } |
| 102 | |
| 103 | message Widget { |
| 104 | required string provider = 1; |
| 105 | optional string label = 2; |
| 106 | optional bool configure = 3; |
| 107 | optional Resource icon = 4; |
| 108 | optional Resource preview = 5; |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 109 | } |