diff options
Diffstat (limited to 'src/com/android/launcher3/LauncherSettings.java')
-rw-r--r-- | src/com/android/launcher3/LauncherSettings.java | 76 |
1 files changed, 44 insertions, 32 deletions
diff --git a/src/com/android/launcher3/LauncherSettings.java b/src/com/android/launcher3/LauncherSettings.java index 3d3c570bf..f2c85a195 100644 --- a/src/com/android/launcher3/LauncherSettings.java +++ b/src/com/android/launcher3/LauncherSettings.java @@ -19,12 +19,14 @@ package com.android.launcher3; import android.net.Uri; import android.provider.BaseColumns; +import com.android.launcher3.config.ProviderConfig; + /** * Settings related utilities. */ public class LauncherSettings { /** Columns required on table staht will be subject to backup and restore. */ - public static interface ChangeLogColumns extends BaseColumns { + static interface ChangeLogColumns extends BaseColumns { /** * The time of the last update to this row. * <P>Type: INTEGER</P> @@ -32,7 +34,7 @@ public class LauncherSettings { public static final String MODIFIED = "modified"; } - public static interface BaseLauncherColumns extends ChangeLogColumns { + static interface BaseLauncherColumns extends ChangeLogColumns { /** * Descriptive name of the gesture that can be displayed to the user. * <P>Type: TEXT</P> @@ -111,9 +113,8 @@ public class LauncherSettings { /** * The content:// style URL for this table */ - public static final Uri CONTENT_URI = Uri.parse("content://" + - LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_WORKSPACE_SCREENS + - "?" + LauncherProvider.PARAMETER_NOTIFY + "=true"); + static final Uri CONTENT_URI = Uri.parse("content://" + + ProviderConfig.AUTHORITY + "/" + TABLE_NAME); /** * The rank of this screen -- ie. how it is ordered relative to the other screens. @@ -126,40 +127,25 @@ public class LauncherSettings { * Favorites. */ public static final class Favorites implements BaseLauncherColumns { - /** - * The content:// style URL for this table - */ - public static final Uri CONTENT_URI = Uri.parse("content://" + - LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES + - "?" + LauncherProvider.PARAMETER_NOTIFY + "=true"); - /** - * The content:// style URL for this table - */ - public static final Uri OLD_CONTENT_URI = Uri.parse("content://" + - LauncherProvider.OLD_AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES + - "?" + LauncherProvider.PARAMETER_NOTIFY + "=true"); + public static final String TABLE_NAME = "favorites"; /** - * The content:// style URL for this table. When this Uri is used, no notification is - * sent if the content changes. + * The content:// style URL for this table */ - public static final Uri CONTENT_URI_NO_NOTIFICATION = Uri.parse("content://" + - LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES + - "?" + LauncherProvider.PARAMETER_NOTIFY + "=false"); + public static final Uri CONTENT_URI = Uri.parse("content://" + + ProviderConfig.AUTHORITY + "/" + TABLE_NAME); /** * 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. */ - public static Uri getContentUri(long id, boolean notify) { - return Uri.parse("content://" + LauncherProvider.AUTHORITY + - "/" + LauncherProvider.TABLE_FAVORITES + "/" + id + "?" + - LauncherProvider.PARAMETER_NOTIFY + "=" + notify); + static Uri getContentUri(long id) { + return Uri.parse("content://" + ProviderConfig.AUTHORITY + + "/" + TABLE_NAME + "/" + id); } /** @@ -174,7 +160,7 @@ public class LauncherSettings { public static final int CONTAINER_DESKTOP = -100; public static final int CONTAINER_HOTSEAT = -101; - public static final String containerToString(int container) { + static final String containerToString(int container) { switch (container) { case CONTAINER_DESKTOP: return "desktop"; case CONTAINER_HOTSEAT: return "hotseat"; @@ -234,7 +220,8 @@ public class LauncherSettings { * exist within the launcher database will be ignored when loading. That said, these * entries in the database may still exist, and are not automatically stripped. */ - public static final int ITEM_TYPE_LIVE_FOLDER = 3; + @Deprecated + static final int ITEM_TYPE_LIVE_FOLDER = 3; /** * The favorite is a widget @@ -249,17 +236,20 @@ public class LauncherSettings { /** * The favorite is a clock */ - public static final int ITEM_TYPE_WIDGET_CLOCK = 1000; + @Deprecated + static final int ITEM_TYPE_WIDGET_CLOCK = 1000; /** * The favorite is a search widget */ - public static final int ITEM_TYPE_WIDGET_SEARCH = 1001; + @Deprecated + static final int ITEM_TYPE_WIDGET_SEARCH = 1001; /** * The favorite is a photo frame */ - public static final int ITEM_TYPE_WIDGET_PHOTO_FRAME = 1002; + @Deprecated + static final int ITEM_TYPE_WIDGET_PHOTO_FRAME = 1002; /** * The appWidgetId of the widget @@ -289,6 +279,7 @@ public class LauncherSettings { * live folders to find the content provider. * <P>Type: TEXT</P> */ + @Deprecated static final String URI = "uri"; /** @@ -312,5 +303,26 @@ public class LauncherSettings { * <p>Type: INTEGER</p> */ public static final String RANK = "rank"; + + /** + * Stores general flag based options for {@link ItemInfo}s. + * <p>Type: INTEGER</p> + */ + public static final String OPTIONS = "options"; + } + + /** + * Launcher settings + */ + public static final class Settings { + + public static final Uri CONTENT_URI = Uri.parse("content://" + + ProviderConfig.AUTHORITY + "/settings"); + + public static final String METHOD_GET_BOOLEAN = "get_boolean_setting"; + public static final String METHOD_SET_BOOLEAN = "set_boolean_setting"; + + public static final String EXTRA_VALUE = "value"; + public static final String EXTRA_DEFAULT_VALUE = "default_value"; } } |