11c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott/* 21c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott * Copyright (C) 2010 The Android Open Source Project 31c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott * 41c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott * Licensed under the Apache License, Version 2.0 (the "License"); 51c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott * you may not use this file except in compliance with the License. 61c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott * You may obtain a copy of the License at 71c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott * 81c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott * http://www.apache.org/licenses/LICENSE-2.0 91c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott * 101c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott * Unless required by applicable law or agreed to in writing, software 111c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott * distributed under the License is distributed on an "AS IS" BASIS, 121c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 131c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott * See the License for the specific language governing permissions and 141c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott * limitations under the License. 151c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott */ 161c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott 171c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scottpackage com.android.browser.widget; 181c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott 191c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scottimport android.app.PendingIntent; 201c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scottimport android.appwidget.AppWidgetManager; 211c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scottimport android.appwidget.AppWidgetProvider; 221c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scottimport android.content.Context; 231c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scottimport android.content.Intent; 241c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scottimport android.util.Log; 251c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott 261c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott/** 271c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott * Widget that shows a preview of the user's bookmarks. 281c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott */ 291c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scottpublic class BookmarkWidgetProvider extends AppWidgetProvider { 301c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott 311c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott static final String TAG = "BookmarkWidgetProvider"; 321c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott 331c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott @Override 341c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott public void onUpdate(Context context, AppWidgetManager mngr, int[] ids) { 351c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott context.startService(new Intent(BookmarkWidgetService.UPDATE, null, 361c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott context, BookmarkWidgetService.class)); 371c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott } 381c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott 391c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott @Override 401c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott public void onEnabled(Context context) { 411c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott context.startService(new Intent(context, BookmarkWidgetService.class)); 421c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott } 431c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott 441c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott @Override 451c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott public void onDisabled(Context context) { 461c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott context.stopService(new Intent(context, BookmarkWidgetService.class)); 471c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott } 481c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott} 491c15ace5e630e361a48cff8f83fef207436bb80bPatrick Scott 50