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 | |
| 21 | option java_package = "com.android.launcher3.backup"; |
| 22 | option java_outer_classname = "BackupProtos"; |
| 23 | |
| 24 | message Key { |
| 25 | enum Type { |
| 26 | FAVORITE = 1; |
| 27 | SCREEN = 2; |
Chris Wren | 22e130d | 2013-09-23 18:25:57 -0400 | [diff] [blame] | 28 | ICON = 3; |
Chris Wren | fd13c71 | 2013-09-27 15:45:19 -0400 | [diff] [blame] | 29 | WIDGET = 4; |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 30 | } |
| 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 | |
| 37 | message CheckedMessage { |
| 38 | required bytes payload = 1; |
| 39 | required int64 checksum = 2; |
| 40 | } |
| 41 | |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 42 | message 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 Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 49 | message Journal { |
| 50 | required int32 app_version = 1; |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 51 | |
| 52 | // Time when the backup was created |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 53 | required int64 t = 2; |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 54 | |
| 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 Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 58 | optional int64 bytes = 3; |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 59 | |
| 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 Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 63 | optional int32 rows = 4; |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 64 | |
| 65 | // Valid keys for this state |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 66 | repeated Key key = 5; |
Sunny Goyal | 33d4438 | 2014-10-16 09:24:19 -0700 | [diff] [blame] | 67 | |
| 68 | // Backup format version. |
| 69 | optional int32 backup_version = 6 [default = 1]; |
| 70 | |
| 71 | optional DeviceProfieData profile = 7; |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | message Favorite { |
Sunny Goyal | bb3b02f | 2015-01-15 12:00:14 -0800 | [diff] [blame] | 75 | // 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 Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 86 | 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 Goyal | bb3b02f | 2015-01-15 12:00:14 -0800 | [diff] [blame] | 104 | optional TargetType targetType = 19 [default = TARGET_NONE]; |
Chris Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 105 | } |
| 106 | |
| 107 | message Screen { |
| 108 | required int64 id = 1; |
| 109 | optional int32 rank = 2; |
| 110 | } |
| 111 | |
| 112 | message Resource { |
Chris Wren | fd13c71 | 2013-09-27 15:45:19 -0400 | [diff] [blame] | 113 | required int32 dpi = 1; |
| 114 | required bytes data = 2; |
| 115 | } |
| 116 | |
| 117 | message 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 Wren | 1ada10d | 2013-09-13 18:01:38 -0400 | [diff] [blame] | 123 | } |