blob: ad032218378535b994ad65d07e27f3abe718fd1f [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;
Hyunyoung Songa38aab92023-03-14 07:56:59 +000044 /**
45 * The default animation for a given view/item info type, but without the splash icon.
46 */
47 public static final int DEFAULT_NO_ICON = 2;
Luca Zuccarini20983812023-01-03 14:19:48 +000048 }
49
50 /**
Sunny Goyalc5939392018-12-07 11:43:47 -080051 * Favorites.
52 */
53 public static final class Favorites implements BaseColumns {
Chris Wren1ada10d2013-09-13 18:01:38 -040054 /**
55 * The time of the last update to this row.
56 * <P>Type: INTEGER</P>
57 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -070058 public static final String MODIFIED = "modified";
Chris Wren1ada10d2013-09-13 18:01:38 -040059
Romain Guy73b979d2009-06-09 12:57:21 -070060 /**
61 * Descriptive name of the gesture that can be displayed to the user.
62 * <P>Type: TEXT</P>
63 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -070064 public static final String TITLE = "title";
Romain Guy73b979d2009-06-09 12:57:21 -070065
66 /**
67 * The Intent URL of the gesture, describing what it points to. This
Romain Guy1ce1a242009-06-23 17:34:54 -070068 * value is given to {@link android.content.Intent#parseUri(String, int)} to create
Romain Guy73b979d2009-06-09 12:57:21 -070069 * an Intent that can be launched.
70 * <P>Type: TEXT</P>
71 */
Sunny Goyal18b640c2015-04-17 09:24:01 -070072 public static final String INTENT = "intent";
Romain Guy73b979d2009-06-09 12:57:21 -070073
74 /**
75 * The type of the gesture
76 *
77 * <P>Type: INTEGER</P>
78 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -070079 public static final String ITEM_TYPE = "itemType";
Romain Guy73b979d2009-06-09 12:57:21 -070080
81 /**
Samuel Fufad3720c22019-09-06 11:25:08 -070082 * The gesture is a package
83 */
84 public static final int ITEM_TYPE_NON_ACTIONABLE = -1;
85 /**
Romain Guy73b979d2009-06-09 12:57:21 -070086 * The gesture is an application
87 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -070088 public static final int ITEM_TYPE_APPLICATION = 0;
Romain Guy73b979d2009-06-09 12:57:21 -070089
90 /**
91 * The gesture is an application created shortcut
92 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -070093 public static final int ITEM_TYPE_SHORTCUT = 1;
Romain Guy73b979d2009-06-09 12:57:21 -070094
95 /**
Andy Wickham19ab1772021-02-10 21:36:51 -080096 * The favorite is a user created folder
97 */
98 public static final int ITEM_TYPE_FOLDER = 2;
99
100 /**
101 * The favorite is a widget
102 */
103 public static final int ITEM_TYPE_APPWIDGET = 4;
104
105 /**
106 * The favorite is a custom widget provided by the launcher
107 */
108 public static final int ITEM_TYPE_CUSTOM_APPWIDGET = 5;
109
110 /**
111 * The gesture is an application created deep shortcut
112 */
113 public static final int ITEM_TYPE_DEEP_SHORTCUT = 6;
114
Jeremy Sim7cf0dd92023-03-24 22:39:45 -0700115 /**
116 * The favorite is an app pair for launching split screen
117 */
118 public static final int ITEM_TYPE_APP_PAIR = 10;
sfufa@google.comca76de02021-09-24 08:55:48 -0700119
Andy Wickham93456812022-10-05 17:58:45 -0700120 // *** Below enum values are used for metrics purpose but not used in Favorites DB ***
sfufa@google.comca76de02021-09-24 08:55:48 -0700121
122 /**
Andy Wickham19ab1772021-02-10 21:36:51 -0800123 * Type of the item is recents task.
Andy Wickham19ab1772021-02-10 21:36:51 -0800124 */
125 public static final int ITEM_TYPE_TASK = 7;
126
127 /**
128 * The item is QSB
129 */
130 public static final int ITEM_TYPE_QSB = 8;
131
132 /**
Andy Wickham93456812022-10-05 17:58:45 -0700133 * The favorite is a search action
134 */
135 public static final int ITEM_TYPE_SEARCH_ACTION = 9;
136
137 /**
Sunny Goyaleb4b7992016-04-21 14:30:18 -0700138 * The icon package name in Intent.ShortcutIconResource
Romain Guy73b979d2009-06-09 12:57:21 -0700139 * <P>Type: TEXT</P>
140 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700141 public static final String ICON_PACKAGE = "iconPackage";
Romain Guy73b979d2009-06-09 12:57:21 -0700142
143 /**
Sunny Goyaleb4b7992016-04-21 14:30:18 -0700144 * The icon resource name in Intent.ShortcutIconResource
Romain Guy73b979d2009-06-09 12:57:21 -0700145 * <P>Type: TEXT</P>
146 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700147 public static final String ICON_RESOURCE = "iconResource";
Romain Guy73b979d2009-06-09 12:57:21 -0700148
149 /**
Sunny Goyaleb4b7992016-04-21 14:30:18 -0700150 * The custom icon bitmap.
Romain Guy73b979d2009-06-09 12:57:21 -0700151 * <P>Type: BLOB</P>
152 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700153 public static final String ICON = "icon";
Sunny Goyal18b640c2015-04-17 09:24:01 -0700154
155 public static final String TABLE_NAME = "favorites";
156
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800157 /**
Tracy Zhoube13d102020-01-12 01:07:59 -0800158 * Backup table created when the favorites table is modified during grid migration
Sunny Goyal161a2142018-10-29 14:02:20 -0700159 */
160 public static final String BACKUP_TABLE_NAME = "favorites_bakup";
161
162 /**
Samuel Fufaf667a132020-05-29 14:47:42 -0700163 * Backup table created when user hotseat is moved to workspace for hybrid hotseat
164 */
165 public static final String HYBRID_HOTSEAT_BACKUP_TABLE = "hotseat_restore_backup";
166
167 /**
Tracy Zhoube13d102020-01-12 01:07:59 -0800168 * Temporary table used specifically for grid migrations during wallpaper preview
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800169 */
Tracy Zhoube13d102020-01-12 01:07:59 -0800170 public static final String PREVIEW_TABLE_NAME = "favorites_preview";
171
172 /**
Tracy Zhouf6018722020-02-06 16:37:16 -0800173 * Temporary table used specifically for multi-db grid migrations
174 */
175 public static final String TMP_TABLE = "favorites_tmp";
176
177 /**
Tracy Zhoube13d102020-01-12 01:07:59 -0800178 * The content:// style URL for "favorites" table
179 */
180 public static final Uri CONTENT_URI = Uri.parse("content://"
181 + LauncherProvider.AUTHORITY + "/" + TABLE_NAME);
182
183 /**
Pinyao Tingf39f3512020-10-28 16:30:42 -0700184 * The content:// style URL for "favorites_bakup" table
185 */
186 public static final Uri BACKUP_CONTENT_URI = Uri.parse("content://"
187 + LauncherProvider.AUTHORITY + "/" + BACKUP_TABLE_NAME);
188
189 /**
Tracy Zhoube13d102020-01-12 01:07:59 -0800190 * The content:// style URL for "favorites_preview" table
191 */
192 public static final Uri PREVIEW_CONTENT_URI = Uri.parse("content://"
193 + LauncherProvider.AUTHORITY + "/" + PREVIEW_TABLE_NAME);
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800194
195 /**
Tracy Zhouf6018722020-02-06 16:37:16 -0800196 * The content:// style URL for "favorites_tmp" table
197 */
198 public static final Uri TMP_CONTENT_URI = Uri.parse("content://"
199 + LauncherProvider.AUTHORITY + "/" + TMP_TABLE);
200
201 /**
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800202 * The content:// style URL for a given row, identified by its id.
203 *
204 * @param id The row id.
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800205 *
206 * @return The unique content URL for the specified row.
207 */
Sunny Goyalefb7e842018-10-04 15:11:00 -0700208 public static Uri getContentUri(int id) {
Tracy Zhoube13d102020-01-12 01:07:59 -0800209 return Uri.parse("content://" + LauncherProvider.AUTHORITY
210 + "/" + TABLE_NAME + "/" + id);
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800211 }
212
213 /**
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800214 * The container holding the favorite
215 * <P>Type: INTEGER</P>
216 */
Sunny Goyal18b640c2015-04-17 09:24:01 -0700217 public static final String CONTAINER = "container";
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800218
219 /**
220 * The icon is a resource identified by a package name and an integer id.
221 */
Sunny Goyal18b640c2015-04-17 09:24:01 -0700222 public static final int CONTAINER_DESKTOP = -100;
223 public static final int CONTAINER_HOTSEAT = -101;
Samuel Fufa866ff002019-08-09 16:16:06 -0700224 public static final int CONTAINER_PREDICTION = -102;
Steven Ng3a835322021-03-02 21:26:00 +0000225 public static final int CONTAINER_WIDGETS_PREDICTION = -111;
Samuel Fufa225ac272019-10-21 02:02:40 -0700226 public static final int CONTAINER_HOTSEAT_PREDICTION = -103;
thiruram261c3a62020-04-29 16:23:15 -0700227 public static final int CONTAINER_ALL_APPS = -104;
thiruram6bf68482020-05-06 22:19:43 -0700228 public static final int CONTAINER_WIDGETS_TRAY = -105;
Yogisha Dixit658c5da2021-05-24 23:23:15 +0100229 public static final int CONTAINER_BOTTOM_WIDGETS_TRAY = -112;
230 public static final int CONTAINER_PIN_WIDGETS = -113;
Brian Isganitisf0ca4ae2021-09-02 16:08:29 -0400231 public static final int CONTAINER_WALLPAPERS = -114;
thiruram63bf8ee2020-06-01 12:03:19 -0700232 public static final int CONTAINER_SHORTCUTS = -107;
Hyunyoung Songf26c7932020-06-06 14:44:27 -0700233 public static final int CONTAINER_SETTINGS = -108;
Hyunyoung Song13c2bc72020-06-10 00:35:35 -0700234 public static final int CONTAINER_TASKSWITCHER = -109;
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800235
thiruram73821a92021-02-05 17:50:37 -0800236 // Represents any of the extended containers implemented in non-AOSP variants.
237 public static final int EXTENDED_CONTAINERS = -200;
238
Yogisha Dixit658c5da2021-05-24 23:23:15 +0100239 public static final int CONTAINER_UNKNOWN = -1;
240
Sunny Goyale396abf2020-04-06 15:11:17 -0700241 public static final String containerToString(int container) {
Dan Sandlerab5fa3a2014-03-06 23:48:04 -0500242 switch (container) {
243 case CONTAINER_DESKTOP: return "desktop";
244 case CONTAINER_HOTSEAT: return "hotseat";
Samuel Fufa866ff002019-08-09 16:16:06 -0700245 case CONTAINER_PREDICTION: return "prediction";
thiruram6bf68482020-05-06 22:19:43 -0700246 case CONTAINER_ALL_APPS: return "all_apps";
247 case CONTAINER_WIDGETS_TRAY: return "widgets_tray";
thiruram63bf8ee2020-06-01 12:03:19 -0700248 case CONTAINER_SHORTCUTS: return "shortcuts";
Dan Sandlerab5fa3a2014-03-06 23:48:04 -0500249 default: return String.valueOf(container);
250 }
251 }
252
Sunny Goyale396abf2020-04-06 15:11:17 -0700253 public static final String itemTypeToString(int type) {
Hyunyoung Song86160f52017-02-06 10:46:24 -0800254 switch(type) {
255 case ITEM_TYPE_APPLICATION: return "APP";
256 case ITEM_TYPE_SHORTCUT: return "SHORTCUT";
257 case ITEM_TYPE_FOLDER: return "FOLDER";
258 case ITEM_TYPE_APPWIDGET: return "WIDGET";
259 case ITEM_TYPE_CUSTOM_APPWIDGET: return "CUSTOMWIDGET";
260 case ITEM_TYPE_DEEP_SHORTCUT: return "DEEPSHORTCUT";
Andy Wickham19ab1772021-02-10 21:36:51 -0800261 case ITEM_TYPE_TASK: return "TASK";
262 case ITEM_TYPE_QSB: return "QSB";
Jeremy Sim7cf0dd92023-03-24 22:39:45 -0700263 case ITEM_TYPE_APP_PAIR: return "APP_PAIR";
Hyunyoung Song86160f52017-02-06 10:46:24 -0800264 default: return String.valueOf(type);
265 }
266 }
267
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800268 /**
269 * The screen holding the favorite (if container is CONTAINER_DESKTOP)
270 * <P>Type: INTEGER</P>
271 */
Sunny Goyal18b640c2015-04-17 09:24:01 -0700272 public static final String SCREEN = "screen";
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800273
274 /**
275 * The X coordinate of the cell holding the favorite
Adam Cohenc51934b2011-07-26 21:07:43 -0700276 * (if container is CONTAINER_HOTSEAT or CONTAINER_HOTSEAT)
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800277 * <P>Type: INTEGER</P>
278 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700279 public static final String CELLX = "cellX";
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800280
281 /**
282 * The Y coordinate of the cell holding the favorite
283 * (if container is CONTAINER_DESKTOP)
284 * <P>Type: INTEGER</P>
285 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700286 public static final String CELLY = "cellY";
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800287
288 /**
289 * The X span of the cell holding the favorite
290 * <P>Type: INTEGER</P>
291 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700292 public static final String SPANX = "spanX";
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800293
294 /**
295 * The Y span of the cell holding the favorite
296 * <P>Type: INTEGER</P>
297 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700298 public static final String SPANY = "spanY";
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800299
300 /**
Kenny Guyed131872014-04-30 03:02:21 +0100301 * The profile id of the item in the cell.
302 * <P>
303 * Type: INTEGER
304 * </P>
305 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700306 public static final String PROFILE_ID = "profileId";
Kenny Guyed131872014-04-30 03:02:21 +0100307
308 /**
The Android Open Source Project7376fae2009-03-11 12:11:58 -0700309 * The appWidgetId of the widget
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800310 *
311 * <P>Type: INTEGER</P>
312 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700313 public static final String APPWIDGET_ID = "appWidgetId";
Chris Wrend5e66bf2013-09-16 14:02:29 -0400314
315 /**
316 * The ComponentName of the widget provider
317 *
318 * <P>Type: STRING</P>
319 */
320 public static final String APPWIDGET_PROVIDER = "appWidgetProvider";
Chris Wrenf4d08112014-01-16 18:13:56 -0500321
322 /**
323 * Boolean indicating that his item was restored and not yet successfully bound.
324 * <P>Type: INTEGER</P>
325 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700326 public static final String RESTORED = "restored";
Sunny Goyal08f72612015-01-05 13:41:43 -0800327
328 /**
329 * Indicates the position of the item inside an auto-arranged view like folder or hotseat.
330 * <p>Type: INTEGER</p>
331 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700332 public static final String RANK = "rank";
Sunny Goyal5d85c442015-03-10 13:14:47 -0700333
334 /**
335 * Stores general flag based options for {@link ItemInfo}s.
336 * <p>Type: INTEGER</p>
337 */
Sunny Goyal2fb2f0b2015-06-22 13:57:26 -0700338 public static final String OPTIONS = "options";
Sunny Goyalc190dbf2016-05-05 14:37:05 -0700339
Yogisha Dixit658c5da2021-05-24 23:23:15 +0100340 /**
341 * Stores the source container that the widget was added from.
342 * <p>Type: INTEGER</p>
343 */
344 public static final String APPWIDGET_SOURCE = "appWidgetSource";
345
Sunny Goyalc190dbf2016-05-05 14:37:05 -0700346 public static void addTableToDb(SQLiteDatabase db, long myProfileId, boolean optional) {
Sunny Goyal161a2142018-10-29 14:02:20 -0700347 addTableToDb(db, myProfileId, optional, TABLE_NAME);
348 }
349
350 public static void addTableToDb(SQLiteDatabase db, long myProfileId, boolean optional,
351 String tableName) {
Sunny Goyalc190dbf2016-05-05 14:37:05 -0700352 String ifNotExists = optional ? " IF NOT EXISTS " : "";
Sunny Goyal161a2142018-10-29 14:02:20 -0700353 db.execSQL("CREATE TABLE " + ifNotExists + tableName + " (" +
Sunny Goyalc190dbf2016-05-05 14:37:05 -0700354 "_id INTEGER PRIMARY KEY," +
355 "title TEXT," +
356 "intent TEXT," +
357 "container INTEGER," +
358 "screen INTEGER," +
359 "cellX INTEGER," +
360 "cellY INTEGER," +
361 "spanX INTEGER," +
362 "spanY INTEGER," +
363 "itemType INTEGER," +
364 "appWidgetId INTEGER NOT NULL DEFAULT -1," +
Sunny Goyalc190dbf2016-05-05 14:37:05 -0700365 "iconPackage TEXT," +
366 "iconResource TEXT," +
367 "icon BLOB," +
368 "appWidgetProvider TEXT," +
369 "modified INTEGER NOT NULL DEFAULT 0," +
370 "restored INTEGER NOT NULL DEFAULT 0," +
371 "profileId INTEGER DEFAULT " + myProfileId + "," +
372 "rank INTEGER NOT NULL DEFAULT 0," +
Yogisha Dixit658c5da2021-05-24 23:23:15 +0100373 "options INTEGER NOT NULL DEFAULT 0," +
374 APPWIDGET_SOURCE + " INTEGER NOT NULL DEFAULT " + CONTAINER_UNKNOWN +
Sunny Goyalc190dbf2016-05-05 14:37:05 -0700375 ");");
376 }
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800377 }
Sunny Goyal7779d622015-06-11 16:18:39 -0700378
379 /**
380 * Launcher settings
381 */
382 public static final class Settings {
383
384 public static final Uri CONTENT_URI = Uri.parse("content://" +
Sunny Goyal3d706ad2017-03-06 16:56:39 -0800385 LauncherProvider.AUTHORITY + "/settings");
Sunny Goyal7779d622015-06-11 16:18:39 -0700386
Sunny Goyald2497482015-09-22 18:24:19 -0700387 public static final String METHOD_CLEAR_EMPTY_DB_FLAG = "clear_empty_db_flag";
388
389 public static final String METHOD_DELETE_EMPTY_FOLDERS = "delete_empty_folders";
Sunny Goyald2497482015-09-22 18:24:19 -0700390
391 public static final String METHOD_NEW_ITEM_ID = "generate_new_item_id";
392 public static final String METHOD_NEW_SCREEN_ID = "generate_new_screen_id";
393
394 public static final String METHOD_CREATE_EMPTY_DB = "create_empty_db";
Sunny Goyald2497482015-09-22 18:24:19 -0700395
Schneider Victor-tuliasfb252e72022-02-10 11:10:21 -0800396 public static final String METHOD_SET_USE_TEST_WORKSPACE_LAYOUT_FLAG =
397 "set_use_test_workspace_layout_flag";
Alex Chauf8b79d42022-12-15 13:41:49 +0000398 public static final String ARG_DEFAULT_WORKSPACE_LAYOUT_TEST = "default_test_workspace";
399 public static final String ARG_DEFAULT_WORKSPACE_LAYOUT_TEST2 = "default_test2_workspace";
Sebastian Franco239ae0a2023-03-03 15:56:52 -0800400 public static final String ARG_DEFAULT_WORKSPACE_LAYOUT_TAPL = "default_tapl_workspace";
Schneider Victor-tuliasfb252e72022-02-10 11:10:21 -0800401
402 public static final String METHOD_CLEAR_USE_TEST_WORKSPACE_LAYOUT_FLAG =
403 "clear_use_test_workspace_layout_flag";
404
Sunny Goyald2497482015-09-22 18:24:19 -0700405 public static final String METHOD_LOAD_DEFAULT_FAVORITES = "load_default_favorites";
Sunny Goyal7779d622015-06-11 16:18:39 -0700406
Sunny Goyal55fddc82017-04-06 15:02:52 -0700407 public static final String METHOD_REMOVE_GHOST_WIDGETS = "remove_ghost_widgets";
408
Sunny Goyal161a2142018-10-29 14:02:20 -0700409 public static final String METHOD_NEW_TRANSACTION = "new_db_transaction";
410
Samuel Fufaf667a132020-05-29 14:47:42 -0700411 public static final String METHOD_REFRESH_HOTSEAT_RESTORE_TABLE = "restore_hotseat_table";
412
Tracy Zhou7df93d22020-01-27 13:44:06 -0800413 public static final String METHOD_UPDATE_CURRENT_OPEN_HELPER = "update_current_open_helper";
414
Tracy Zhouc0000452020-03-17 18:28:38 -0700415 public static final String METHOD_PREP_FOR_PREVIEW = "prep_for_preview";
416
Sunny Goyal7779d622015-06-11 16:18:39 -0700417 public static final String EXTRA_VALUE = "value";
Sunny Goyald2497482015-09-22 18:24:19 -0700418
Pinyao Ting702ed272020-10-14 11:17:04 -0700419 public static final String EXTRA_DB_NAME = "db_name";
420
Sunny Goyald2497482015-09-22 18:24:19 -0700421 public static Bundle call(ContentResolver cr, String method) {
Pinyao Ting96186af2020-07-20 11:03:39 -0700422 return call(cr, method, null /* arg */);
Tracy Zhouc0000452020-03-17 18:28:38 -0700423 }
424
425 public static Bundle call(ContentResolver cr, String method, String arg) {
Pinyao Ting96186af2020-07-20 11:03:39 -0700426 return call(cr, method, arg, null /* extras */);
427 }
428
429 public static Bundle call(ContentResolver cr, String method, String arg, Bundle extras) {
430 return cr.call(CONTENT_URI, method, arg, extras);
Sunny Goyald2497482015-09-22 18:24:19 -0700431 }
Sunny Goyal7779d622015-06-11 16:18:39 -0700432 }
The Android Open Source Project31dd5032009-03-03 19:32:27 -0800433}