backup.proto 3.3 KB

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