blob: 66ea616ffec35a1c5e2ea4785926d776a52c59f5 [file] [log] [blame]
The Android Open Source Project31dd5032009-03-03 19:32:27 -08001/*
2 * Copyright (C) 2008 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
Daniel Sandler325dc232013-06-05 22:57:57 -040017package com.android.launcher3;
The Android Open Source Project31dd5032009-03-03 19:32:27 -080018
Sunny Goyald2497482015-09-22 18:24:19 -070019import android.content.ContentResolver;
Sunny Goyalc190dbf2016-05-05 14:37:05 -070020import android.database.sqlite.SQLiteDatabase;
The Android Open Source Project31dd5032009-03-03 19:32:27 -080021import android.net.Uri;
Sunny Goyald2497482015-09-22 18:24:19 -070022import android.os.Bundle;
Adam Cohendf2cc412011-04-27 16:56:57 -070023import android.provider.BaseColumns;
The Android Open Source Project31dd5032009-03-03 19:32:27 -080024
Sunny Goyale396abf2020-04-06 15:11:17 -070025import com.android.launcher3.model.data.ItemInfo;
26
The Android Open Source Project31dd5032009-03-03 19:32:27 -080027/**
28 * Settings related utilities.
29 */
Hyunyoung Song3f471442015-04-08 19:01:34 -070030public class LauncherSettings {
Sunny Goyalc5939392018-12-07 11:43:47 -080031
32 /**
Luca Zuccarini20983812023-01-03 14:19:48 +000033 * Types of animations.
34 */
35 public static final class Animation {
36 /**
37 * The default animation for a given view/item info type.
38 */
39 public static final int DEFAULT = 0;
40 /**
41 * An animation using the view's background.
42 */
43 public static final int VIEW_BACKGROUND = 1;
44 }
45
46 /**
Sunny Goyalc5939392018-12-07 11:43:47 -080047 * Favorites.
48 */
49 public static final class Favorites implements BaseColumns {
Chris Wren1ada10d2013-09-13 18:01:38 -040050 /**
51 * The time of the last update to this row.
52 * <P>Type: INTEGER</P>
53 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -070054 public static final String MODIFIED = "modified";
Chris Wren1ada10d2013-09-13 18:01:38 -040055
Romain Guy73b979d2009-06-09 12:57:21 -070056 /**
57 * Descriptive name of the gesture that can be displayed to the user.
58 * <P>Type: TEXT</P>
59 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -070060 public static final String TITLE = "title";
Romain Guy73b979d2009-06-09 12:57:21 -070061
62 /**
63 * The Intent URL of the gesture, describing what it points to. This
Romain Guy1ce1a242009-06-23 17:34:54 -070064 * value is given to {@link android.content.Intent#parseUri(String, int)} to create
Romain Guy73b979d2009-06-09 12:57:21 -070065 * an Intent that can be launched.
66 * <P>Type: TEXT</P>
67 */
Sunny Goyal18b640c2015-04-17 09:24:01 -070068 public static final String INTENT = "intent";
Romain Guy73b979d2009-06-09 12:57:21 -070069
70 /**
71 * The type of the gesture
72 *
73 * <P>Type: INTEGER</P>
74 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -070075 public static final String ITEM_TYPE = "itemType";
Romain Guy73b979d2009-06-09 12:57:21 -070076
77 /**
Samuel Fufad3720c22019-09-06 11:25:08 -070078 * The gesture is a package
79 */
80 public static final int ITEM_TYPE_NON_ACTIONABLE = -1;
81 /**
Romain Guy73b979d2009-06-09 12:57:21 -070082 * The gesture is an application
83 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -070084 public static final int ITEM_TYPE_APPLICATION = 0;
Romain Guy73b979d2009-06-09 12:57:21 -070085
86 /**
87 * The gesture is an application created shortcut
88 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -070089 public static final int ITEM_TYPE_SHORTCUT = 1;
Romain Guy73b979d2009-06-09 12:57:21 -070090
91 /**
Andy Wickham19ab1772021-02-10 21:36:51 -080092 * The favorite is a user created folder
93 */
94 public static final int ITEM_TYPE_FOLDER = 2;
95
96 /**
97 * The favorite is a widget
98 */
99 public static final int ITEM_TYPE_APPWIDGET = 4;
100
101 /**
102 * The favorite is a custom widget provided by the launcher
103 */
104 public static final int ITEM_TYPE_CUSTOM_APPWIDGET = 5;
105
106 /**
107 * The gesture is an application created deep shortcut
108 */
109 public static final int ITEM_TYPE_DEEP_SHORTCUT = 6;
110
sfufa@google.comca76de02021-09-24 08:55:48 -0700111
Andy Wickham93456812022-10-05 17:58:45 -0700112 // *** Below enum values are used for metrics purpose but not used in Favorites DB ***
sfufa@google.comca76de02021-09-24 08:55:48 -0700113
114 /**
Andy Wickham19ab1772021-02-10 21:36:51 -0800115 * Type of the item is recents task.
Andy Wickham19ab1772021-02-10 21:36:51 -0800116 */
117 public static final int ITEM_TYPE_TASK = 7;
118
119 /**
120 * The item is QSB
121 */
122 public static final int ITEM_TYPE_QSB = 8;
123
124 /**
Andy Wickham93456812022-10-05 17:58:45 -0700125 * The favorite is a search action
126 */
127 public static final int ITEM_TYPE_SEARCH_ACTION = 9;
128
129 /**
Sunny Goyaleb4b7992016-04-21 14:30:18 -0700130 * The icon package name in Intent.ShortcutIconResource
Romain Guy73b979d2009-06-09 12:57:21 -0700131 * <P>Type: TEXT</P>
132 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700133 public static final String ICON_PACKAGE = "iconPackage";
Romain Guy73b979d2009-06-09 12:57:21 -0700134
135 /**
Sunny Goyaleb4b7992016-04-21 14:30:18 -0700136 * The icon resource name in Intent.ShortcutIconResource
Romain Guy73b979d2009-06-09 12:57:21 -0700137 * <P>Type: TEXT</P>
138 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700139 public static final String ICON_RESOURCE = "iconResource";
Romain Guy73b979d2009-06-09 12:57:21 -0700140
141 /**
Sunny Goyaleb4b7992016-04-21 14:30:18 -0700142 * The custom icon bitmap.
Romain Guy73b979d2009-06-09 12:57:21 -0700143 * <P>Type: BLOB</P>
144 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700145 public static final String ICON = "icon";
Sunny Goyal18b640c2015-04-17 09:24:01 -0700146
147 public static final String TABLE_NAME = "favorites";
148
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800149 /**
Tracy Zhoube13d102020-01-12 01:07:59 -0800150 * Backup table created when the favorites table is modified during grid migration
Sunny Goyal161a2142018-10-29 14:02:20 -0700151 */
152 public static final String BACKUP_TABLE_NAME = "favorites_bakup";
153
154 /**
Samuel Fufaf667a132020-05-29 14:47:42 -0700155 * Backup table created when user hotseat is moved to workspace for hybrid hotseat
156 */
157 public static final String HYBRID_HOTSEAT_BACKUP_TABLE = "hotseat_restore_backup";
158
159 /**
Tracy Zhoube13d102020-01-12 01:07:59 -0800160 * Temporary table used specifically for grid migrations during wallpaper preview
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800161 */
Tracy Zhoube13d102020-01-12 01:07:59 -0800162 public static final String PREVIEW_TABLE_NAME = "favorites_preview";
163
164 /**
Tracy Zhouf6018722020-02-06 16:37:16 -0800165 * Temporary table used specifically for multi-db grid migrations
166 */
167 public static final String TMP_TABLE = "favorites_tmp";
168
169 /**
Tracy Zhoube13d102020-01-12 01:07:59 -0800170 * The content:// style URL for "favorites" table
171 */
172 public static final Uri CONTENT_URI = Uri.parse("content://"
173 + LauncherProvider.AUTHORITY + "/" + TABLE_NAME);
174
175 /**
Pinyao Tingf39f3512020-10-28 16:30:42 -0700176 * The content:// style URL for "favorites_bakup" table
177 */
178 public static final Uri BACKUP_CONTENT_URI = Uri.parse("content://"
179 + LauncherProvider.AUTHORITY + "/" + BACKUP_TABLE_NAME);
180
181 /**
Tracy Zhoube13d102020-01-12 01:07:59 -0800182 * The content:// style URL for "favorites_preview" table
183 */
184 public static final Uri PREVIEW_CONTENT_URI = Uri.parse("content://"
185 + LauncherProvider.AUTHORITY + "/" + PREVIEW_TABLE_NAME);
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800186
187 /**
Tracy Zhouf6018722020-02-06 16:37:16 -0800188 * The content:// style URL for "favorites_tmp" table
189 */
190 public static final Uri TMP_CONTENT_URI = Uri.parse("content://"
191 + LauncherProvider.AUTHORITY + "/" + TMP_TABLE);
192
193 /**
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800194 * The content:// style URL for a given row, identified by its id.
195 *
196 * @param id The row id.
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800197 *
198 * @return The unique content URL for the specified row.
199 */
Sunny Goyalefb7e842018-10-04 15:11:00 -0700200 public static Uri getContentUri(int id) {
Tracy Zhoube13d102020-01-12 01:07:59 -0800201 return Uri.parse("content://" + LauncherProvider.AUTHORITY
202 + "/" + TABLE_NAME + "/" + id);
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800203 }
204
205 /**
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800206 * The container holding the favorite
207 * <P>Type: INTEGER</P>
208 */
Sunny Goyal18b640c2015-04-17 09:24:01 -0700209 public static final String CONTAINER = "container";
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800210
211 /**
212 * The icon is a resource identified by a package name and an integer id.
213 */
Sunny Goyal18b640c2015-04-17 09:24:01 -0700214 public static final int CONTAINER_DESKTOP = -100;
215 public static final int CONTAINER_HOTSEAT = -101;
Samuel Fufa866ff002019-08-09 16:16:06 -0700216 public static final int CONTAINER_PREDICTION = -102;
Steven Ng3a835322021-03-02 21:26:00 +0000217 public static final int CONTAINER_WIDGETS_PREDICTION = -111;
Samuel Fufa225ac272019-10-21 02:02:40 -0700218 public static final int CONTAINER_HOTSEAT_PREDICTION = -103;
thiruram261c3a62020-04-29 16:23:15 -0700219 public static final int CONTAINER_ALL_APPS = -104;
thiruram6bf68482020-05-06 22:19:43 -0700220 public static final int CONTAINER_WIDGETS_TRAY = -105;
Yogisha Dixit658c5da2021-05-24 23:23:15 +0100221 public static final int CONTAINER_BOTTOM_WIDGETS_TRAY = -112;
222 public static final int CONTAINER_PIN_WIDGETS = -113;
Brian Isganitisf0ca4ae2021-09-02 16:08:29 -0400223 public static final int CONTAINER_WALLPAPERS = -114;
thiruram63bf8ee2020-06-01 12:03:19 -0700224 public static final int CONTAINER_SHORTCUTS = -107;
Hyunyoung Songf26c7932020-06-06 14:44:27 -0700225 public static final int CONTAINER_SETTINGS = -108;
Hyunyoung Song13c2bc72020-06-10 00:35:35 -0700226 public static final int CONTAINER_TASKSWITCHER = -109;
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800227
thiruram73821a92021-02-05 17:50:37 -0800228 // Represents any of the extended containers implemented in non-AOSP variants.
229 public static final int EXTENDED_CONTAINERS = -200;
230
Yogisha Dixit658c5da2021-05-24 23:23:15 +0100231 public static final int CONTAINER_UNKNOWN = -1;
232
Sunny Goyale396abf2020-04-06 15:11:17 -0700233 public static final String containerToString(int container) {
Dan Sandlerab5fa3a2014-03-06 23:48:04 -0500234 switch (container) {
235 case CONTAINER_DESKTOP: return "desktop";
236 case CONTAINER_HOTSEAT: return "hotseat";
Samuel Fufa866ff002019-08-09 16:16:06 -0700237 case CONTAINER_PREDICTION: return "prediction";
thiruram6bf68482020-05-06 22:19:43 -0700238 case CONTAINER_ALL_APPS: return "all_apps";
239 case CONTAINER_WIDGETS_TRAY: return "widgets_tray";
thiruram63bf8ee2020-06-01 12:03:19 -0700240 case CONTAINER_SHORTCUTS: return "shortcuts";
Dan Sandlerab5fa3a2014-03-06 23:48:04 -0500241 default: return String.valueOf(container);
242 }
243 }
244
Sunny Goyale396abf2020-04-06 15:11:17 -0700245 public static final String itemTypeToString(int type) {
Hyunyoung Song86160f52017-02-06 10:46:24 -0800246 switch(type) {
247 case ITEM_TYPE_APPLICATION: return "APP";
248 case ITEM_TYPE_SHORTCUT: return "SHORTCUT";
249 case ITEM_TYPE_FOLDER: return "FOLDER";
250 case ITEM_TYPE_APPWIDGET: return "WIDGET";
251 case ITEM_TYPE_CUSTOM_APPWIDGET: return "CUSTOMWIDGET";
252 case ITEM_TYPE_DEEP_SHORTCUT: return "DEEPSHORTCUT";
Andy Wickham19ab1772021-02-10 21:36:51 -0800253 case ITEM_TYPE_TASK: return "TASK";
254 case ITEM_TYPE_QSB: return "QSB";
Hyunyoung Song86160f52017-02-06 10:46:24 -0800255 default: return String.valueOf(type);
256 }
257 }
258
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800259 /**
260 * The screen holding the favorite (if container is CONTAINER_DESKTOP)
261 * <P>Type: INTEGER</P>
262 */
Sunny Goyal18b640c2015-04-17 09:24:01 -0700263 public static final String SCREEN = "screen";
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800264
265 /**
266 * The X coordinate of the cell holding the favorite
Adam Cohenc51934b2011-07-26 21:07:43 -0700267 * (if container is CONTAINER_HOTSEAT or CONTAINER_HOTSEAT)
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800268 * <P>Type: INTEGER</P>
269 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700270 public static final String CELLX = "cellX";
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800271
272 /**
273 * The Y coordinate of the cell holding the favorite
274 * (if container is CONTAINER_DESKTOP)
275 * <P>Type: INTEGER</P>
276 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700277 public static final String CELLY = "cellY";
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800278
279 /**
280 * The X span of the cell holding the favorite
281 * <P>Type: INTEGER</P>
282 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700283 public static final String SPANX = "spanX";
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800284
285 /**
286 * The Y span of the cell holding the favorite
287 * <P>Type: INTEGER</P>
288 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700289 public static final String SPANY = "spanY";
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800290
291 /**
Kenny Guyed131872014-04-30 03:02:21 +0100292 * The profile id of the item in the cell.
293 * <P>
294 * Type: INTEGER
295 * </P>
296 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700297 public static final String PROFILE_ID = "profileId";
Kenny Guyed131872014-04-30 03:02:21 +0100298
299 /**
The Android Open Source Project7376fae2009-03-11 12:11:58 -0700300 * The appWidgetId of the widget
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800301 *
302 * <P>Type: INTEGER</P>
303 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700304 public static final String APPWIDGET_ID = "appWidgetId";
Chris Wrend5e66bf2013-09-16 14:02:29 -0400305
306 /**
307 * The ComponentName of the widget provider
308 *
309 * <P>Type: STRING</P>
310 */
311 public static final String APPWIDGET_PROVIDER = "appWidgetProvider";
Chris Wrenf4d08112014-01-16 18:13:56 -0500312
313 /**
314 * Boolean indicating that his item was restored and not yet successfully bound.
315 * <P>Type: INTEGER</P>
316 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700317 public static final String RESTORED = "restored";
Sunny Goyal08f72612015-01-05 13:41:43 -0800318
319 /**
320 * Indicates the position of the item inside an auto-arranged view like folder or hotseat.
321 * <p>Type: INTEGER</p>
322 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700323 public static final String RANK = "rank";
Sunny Goyal5d85c442015-03-10 13:14:47 -0700324
325 /**
326 * Stores general flag based options for {@link ItemInfo}s.
327 * <p>Type: INTEGER</p>
328 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700329 public static final String OPTIONS = "options";
Sunny Goyalc190dbf2016-05-05 14:37:05 -0700330
Yogisha Dixit658c5da2021-05-24 23:23:15 +0100331 /**
332 * Stores the source container that the widget was added from.
333 * <p>Type: INTEGER</p>
334 */
335 public static final String APPWIDGET_SOURCE = "appWidgetSource";
336
Sunny Goyalc190dbf2016-05-05 14:37:05 -0700337 public static void addTableToDb(SQLiteDatabase db, long myProfileId, boolean optional) {
Sunny Goyal161a2142018-10-29 14:02:20 -0700338 addTableToDb(db, myProfileId, optional, TABLE_NAME);
339 }
340
341 public static void addTableToDb(SQLiteDatabase db, long myProfileId, boolean optional,
342 String tableName) {
Sunny Goyalc190dbf2016-05-05 14:37:05 -0700343 String ifNotExists = optional ? " IF NOT EXISTS " : "";
Sunny Goyal161a2142018-10-29 14:02:20 -0700344 db.execSQL("CREATE TABLE " + ifNotExists + tableName + " (" +
Sunny Goyalc190dbf2016-05-05 14:37:05 -0700345 "_id INTEGER PRIMARY KEY," +
346 "title TEXT," +
347 "intent TEXT," +
348 "container INTEGER," +
349 "screen INTEGER," +
350 "cellX INTEGER," +
351 "cellY INTEGER," +
352 "spanX INTEGER," +
353 "spanY INTEGER," +
354 "itemType INTEGER," +
355 "appWidgetId INTEGER NOT NULL DEFAULT -1," +
Sunny Goyalc190dbf2016-05-05 14:37:05 -0700356 "iconPackage TEXT," +
357 "iconResource TEXT," +
358 "icon BLOB," +
359 "appWidgetProvider TEXT," +
360 "modified INTEGER NOT NULL DEFAULT 0," +
361 "restored INTEGER NOT NULL DEFAULT 0," +
362 "profileId INTEGER DEFAULT " + myProfileId + "," +
363 "rank INTEGER NOT NULL DEFAULT 0," +
Yogisha Dixit658c5da2021-05-24 23:23:15 +0100364 "options INTEGER NOT NULL DEFAULT 0," +
365 APPWIDGET_SOURCE + " INTEGER NOT NULL DEFAULT " + CONTAINER_UNKNOWN +
Sunny Goyalc190dbf2016-05-05 14:37:05 -0700366 ");");
367 }
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800368 }
Sunny Goyal7779d622015-06-11 16:18:39 -0700369
370 /**
371 * Launcher settings
372 */
373 public static final class Settings {
374
375 public static final Uri CONTENT_URI = Uri.parse("content://" +
Sunny Goyal3d706ad2017-03-06 16:56:39 -0800376 LauncherProvider.AUTHORITY + "/settings");
Sunny Goyal7779d622015-06-11 16:18:39 -0700377
Sunny Goyald2497482015-09-22 18:24:19 -0700378 public static final String METHOD_CLEAR_EMPTY_DB_FLAG = "clear_empty_db_flag";
Sunny Goyala5c8a9e2016-07-08 08:32:44 -0700379 public static final String METHOD_WAS_EMPTY_DB_CREATED = "get_empty_db_flag";
Sunny Goyald2497482015-09-22 18:24:19 -0700380
381 public static final String METHOD_DELETE_EMPTY_FOLDERS = "delete_empty_folders";
Sunny Goyald2497482015-09-22 18:24:19 -0700382
383 public static final String METHOD_NEW_ITEM_ID = "generate_new_item_id";
384 public static final String METHOD_NEW_SCREEN_ID = "generate_new_screen_id";
385
386 public static final String METHOD_CREATE_EMPTY_DB = "create_empty_db";
Sunny Goyald2497482015-09-22 18:24:19 -0700387
Schneider Victor-tuliasfb252e72022-02-10 11:10:21 -0800388 public static final String METHOD_SET_USE_TEST_WORKSPACE_LAYOUT_FLAG =
389 "set_use_test_workspace_layout_flag";
Alex Chauf8b79d42022-12-15 13:41:49 +0000390 public static final String ARG_DEFAULT_WORKSPACE_LAYOUT_TEST = "default_test_workspace";
391 public static final String ARG_DEFAULT_WORKSPACE_LAYOUT_TEST2 = "default_test2_workspace";
Schneider Victor-tuliasfb252e72022-02-10 11:10:21 -0800392
393 public static final String METHOD_CLEAR_USE_TEST_WORKSPACE_LAYOUT_FLAG =
394 "clear_use_test_workspace_layout_flag";
395
Sunny Goyald2497482015-09-22 18:24:19 -0700396 public static final String METHOD_LOAD_DEFAULT_FAVORITES = "load_default_favorites";
Sunny Goyal7779d622015-06-11 16:18:39 -0700397
Sunny Goyal55fddc82017-04-06 15:02:52 -0700398 public static final String METHOD_REMOVE_GHOST_WIDGETS = "remove_ghost_widgets";
399
Sunny Goyal161a2142018-10-29 14:02:20 -0700400 public static final String METHOD_NEW_TRANSACTION = "new_db_transaction";
401
402 public static final String METHOD_REFRESH_BACKUP_TABLE = "refresh_backup_table";
403
Samuel Fufaf667a132020-05-29 14:47:42 -0700404 public static final String METHOD_REFRESH_HOTSEAT_RESTORE_TABLE = "restore_hotseat_table";
405
Pinyao Tingba9c5572019-09-24 14:25:46 -0700406 public static final String METHOD_RESTORE_BACKUP_TABLE = "restore_backup_table";
407
Tracy Zhou7df93d22020-01-27 13:44:06 -0800408 public static final String METHOD_UPDATE_CURRENT_OPEN_HELPER = "update_current_open_helper";
409
Tracy Zhouc0000452020-03-17 18:28:38 -0700410 public static final String METHOD_PREP_FOR_PREVIEW = "prep_for_preview";
411
Pinyao Ting96186af2020-07-20 11:03:39 -0700412 public static final String METHOD_SWITCH_DATABASE = "switch_database";
413
Sunny Goyal7779d622015-06-11 16:18:39 -0700414 public static final String EXTRA_VALUE = "value";
Sunny Goyald2497482015-09-22 18:24:19 -0700415
Pinyao Ting702ed272020-10-14 11:17:04 -0700416 public static final String EXTRA_DB_NAME = "db_name";
417
Sunny Goyald2497482015-09-22 18:24:19 -0700418 public static Bundle call(ContentResolver cr, String method) {
Pinyao Ting96186af2020-07-20 11:03:39 -0700419 return call(cr, method, null /* arg */);
Tracy Zhouc0000452020-03-17 18:28:38 -0700420 }
421
422 public static Bundle call(ContentResolver cr, String method, String arg) {
Pinyao Ting96186af2020-07-20 11:03:39 -0700423 return call(cr, method, arg, null /* extras */);
424 }
425
426 public static Bundle call(ContentResolver cr, String method, String arg, Bundle extras) {
427 return cr.call(CONTENT_URI, method, arg, extras);
Sunny Goyald2497482015-09-22 18:24:19 -0700428 }
Sunny Goyal7779d622015-06-11 16:18:39 -0700429 }
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800430}