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 17syntax = "proto2"; 18 19package launcher_backup; 20 21option java_package = "com.android.launcher3.backup.nano"; 22option java_outer_classname = "BackupProtos"; 23 24message Key { 25 enum Type { 26 FAVORITE = 1; 27 SCREEN = 2; 28 ICON = 3; 29 WIDGET = 4; 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 37message CheckedMessage { 38 required bytes payload = 1; 39 required int64 checksum = 2; 40} 41 42message 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 49message Journal { 50 required int32 app_version = 1; 51 52 // Time when the backup was created 53 required int64 t = 2; 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 58 optional int64 bytes = 3; 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 63 optional int32 rows = 4; 64 65 // Valid keys for this state 66 repeated Key key = 5; 67 68 // Backup format version. 69 optional int32 backup_version = 6 [default = 1]; 70 71 optional DeviceProfieData profile = 7; 72} 73 74message Favorite { 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 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; 104 105 // Added in backup version 4 106 optional TargetType targetType = 19 [default = TARGET_NONE]; 107 optional int32 rank = 20; 108} 109 110message Screen { 111 required int64 id = 1; 112 optional int32 rank = 2; 113} 114 115message Resource { 116 required int32 dpi = 1; 117 required bytes data = 2; 118} 119 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; 126 127 // Added in backup version 3 128 // 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} 132