OSDN Git Service

Improve notification UX.
[android-x86/packages-apps-Eleven.git] / src / com / cyanogenmod / eleven / appwidgets / AppWidgetBase.java
1 /*
2  * Copyright (C) 2012 Andrew Neal
3  * Copyright (C) 2014 The CyanogenMod Project
4  * Licensed under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with the
6  * License. You may obtain a copy of the License at
7  * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
8  * or agreed to in writing, software distributed under the License is
9  * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
10  * KIND, either express or implied. See the License for the specific language
11  * governing permissions and limitations under the License.
12  */
13
14 package com.cyanogenmod.eleven.appwidgets;
15
16 import android.app.PendingIntent;
17 import android.appwidget.AppWidgetProvider;
18 import android.content.ComponentName;
19 import android.content.Context;
20 import android.content.Intent;
21
22 import com.cyanogenmod.eleven.MusicPlaybackService;
23
24 public abstract class AppWidgetBase extends AppWidgetProvider {
25
26     protected PendingIntent buildPendingIntent(Context context, final String action,
27             final ComponentName serviceName) {
28         Intent intent = new Intent(action);
29         intent.setComponent(serviceName);
30         return PendingIntent.getService(context, 0, intent, 0);
31     }
32
33 }