1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.launcher;
import android.provider.BaseColumns;
import android.net.Uri;
/**
* Settings related utilities.
*/
class LauncherSettings {
/**
* Favorites.
*/
static final class Favorites implements BaseColumns {
/**
* The content:// style URL for this table
*/
static final Uri CONTENT_URI = Uri.parse("content://" +
LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES +
"?" + LauncherProvider.PARAMETER_NOTIFY + "=true");
/**
* The content:// style URL for this table. When this Uri is used, no notification is
* sent if the content changes.
*/
static final Uri CONTENT_URI_NO_NOTIFICATION = Uri.parse("content://" +
LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES +
"?" + LauncherProvider.PARAMETER_NOTIFY + "=false");
/**
* The content:// style URL for a given row, identified by its id.
*
* @param id The row id.
* @param notify True to send a notification is the content changes.
*
* @return The unique content URL for the specified row.
*/
static Uri getContentUri(long id, boolean notify) {
return Uri.parse("content://" + LauncherProvider.AUTHORITY +
"/" + LauncherProvider.TABLE_FAVORITES + "/" + id + "?" +
LauncherProvider.PARAMETER_NOTIFY + "=" + notify);
}
/**
* The row ID.
* <p>Type: INTEGER</p>
*/
static final String ID = "_id";
/**
* Descriptive name of the favorite that can be displayed to the user.
* <P>Type: TEXT</P>
*/
static final String TITLE = "title";
/**
* The Intent URL of the favorite, describing what it points to. This
* value is given to {@link android.content.Intent#getIntent} to create
* an Intent that can be launched.
* <P>Type: TEXT</P>
*/
static final String INTENT = "intent";
/**
* The container holding the favorite
* <P>Type: INTEGER</P>
*/
static final String CONTAINER = "container";
/**
* The icon is a resource identified by a package name and an integer id.
*/
static final int CONTAINER_DESKTOP = -100;
/**
* The screen holding the favorite (if container is CONTAINER_DESKTOP)
* <P>Type: INTEGER</P>
*/
static final String SCREEN = "screen";
/**
* The X coordinate of the cell holding the favorite
* (if container is CONTAINER_DESKTOP or CONTAINER_DOCK)
* <P>Type: INTEGER</P>
*/
static final String CELLX = "cellX";
/**
* The Y coordinate of the cell holding the favorite
* (if container is CONTAINER_DESKTOP)
* <P>Type: INTEGER</P>
*/
static final String CELLY = "cellY";
/**
* The X span of the cell holding the favorite
* <P>Type: INTEGER</P>
*/
static final String SPANX = "spanX";
/**
* The Y span of the cell holding the favorite
* <P>Type: INTEGER</P>
*/
static final String SPANY = "spanY";
/**
* The type of the favorite
*
* <P>Type: INTEGER</P>
*/
static final String ITEM_TYPE = "itemType";
/**
* The favorite is an application
*/
static final int ITEM_TYPE_APPLICATION = 0;
/**
* The favorite is an application created shortcut
*/
static final int ITEM_TYPE_SHORTCUT = 1;
/**
* The favorite is a user created folder
*/
static final int ITEM_TYPE_USER_FOLDER = 2;
/**
* The favorite is a live folder
*/
static final int ITEM_TYPE_LIVE_FOLDER = 3;
/**
* The favorite is a clock
*/
static final int ITEM_TYPE_WIDGET_CLOCK = 1000;
/**
* The favorite is a search widget
*/
static final int ITEM_TYPE_WIDGET_SEARCH = 1001;
/**
* The favorite is a photo frame
*/
static final int ITEM_TYPE_WIDGET_PHOTO_FRAME = 1002;
/**
* Indicates whether this favorite is an application-created shortcut or not.
* If the value is 0, the favorite is not an application-created shortcut, if the
* value is 1, it is an application-created shortcut.
* <P>Type: INTEGER</P>
*/
static final String IS_SHORTCUT = "isShortcut";
/**
* The icon type.
* <P>Type: INTEGER</P>
*/
static final String ICON_TYPE = "iconType";
/**
* The icon is a resource identified by a package name and an integer id.
*/
static final int ICON_TYPE_RESOURCE = 0;
/**
* The icon is a bitmap.
*/
static final int ICON_TYPE_BITMAP = 1;
/**
* The icon package name, if icon type is ICON_TYPE_RESOURCE.
* <P>Type: TEXT</P>
*/
static final String ICON_PACKAGE = "iconPackage";
/**
* The icon resource id, if icon type is ICON_TYPE_RESOURCE.
* <P>Type: TEXT</P>
*/
static final String ICON_RESOURCE = "iconResource";
/**
* The custom icon bitmap, if icon type is ICON_TYPE_BITMAP.
* <P>Type: BLOB</P>
*/
static final String ICON = "icon";
/**
* The URI associated with the favorite. It is used, for instance, by
* live folders to find the content provider.
* <P>Type: TEXT</P>
*/
static final String URI = "uri";
/**
* The display mode if the item is a live folder.
* <P>Type: INTEGER</P>
*
* @see android.provider.LiveFolders#DISPLAY_MODE_GRID
* @see android.provider.LiveFolders#DISPLAY_MODE_LIST
*/
static final String DISPLAY_MODE = "displayMode";
}
}
|