2 * Copyright (C) 2009 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package com.android.launcher;
19 import android.content.ContentValues;
20 import android.gadget.GadgetHostView;
23 * Represents a gadget, which just contains an identifier.
25 class LauncherGadgetInfo extends ItemInfo {
28 * Identifier for this gadget when talking with {@link GadgetManager} for updates.
33 * View that holds this gadget after it's been created. This view isn't created
34 * until Launcher knows it's needed.
36 GadgetHostView hostView = null;
38 LauncherGadgetInfo(int gadgetId) {
39 itemType = LauncherSettings.Favorites.ITEM_TYPE_GADGET;
40 this.gadgetId = gadgetId;
44 void onAddToDatabase(ContentValues values) {
45 super.onAddToDatabase(values);
46 values.put(LauncherSettings.Favorites.GADGET_ID, gadgetId);
50 public String toString() {
51 return Integer.toString(gadgetId);