Merge "Tweaking how settings adds keyguard widgets" into jb-mr1-dev
This commit is contained in:
@@ -19,6 +19,7 @@ package android.appwidget;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import android.app.ActivityThread;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
@@ -201,12 +202,15 @@ public class AppWidgetHost {
|
|||||||
* @return a appWidgetId
|
* @return a appWidgetId
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public static int allocateAppWidgetIdForHost(String packageName, int hostId) {
|
public static int allocateAppWidgetIdForSystem(int hostId) {
|
||||||
checkCallerIsSystem();
|
checkCallerIsSystem();
|
||||||
try {
|
try {
|
||||||
if (sService == null) {
|
if (sService == null) {
|
||||||
bindService();
|
bindService();
|
||||||
}
|
}
|
||||||
|
Context systemContext =
|
||||||
|
(Context) ActivityThread.currentActivityThread().getSystemContext();
|
||||||
|
String packageName = systemContext.getPackageName();
|
||||||
return sService.allocateAppWidgetId(packageName, hostId);
|
return sService.allocateAppWidgetId(packageName, hostId);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
throw new RuntimeException("system server dead?", e);
|
throw new RuntimeException("system server dead?", e);
|
||||||
@@ -240,7 +244,7 @@ public class AppWidgetHost {
|
|||||||
* Stop listening to changes for this AppWidget.
|
* Stop listening to changes for this AppWidget.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public static void deleteAppWidgetIdForHost(int appWidgetId) {
|
public static void deleteAppWidgetIdForSystem(int appWidgetId) {
|
||||||
checkCallerIsSystem();
|
checkCallerIsSystem();
|
||||||
try {
|
try {
|
||||||
if (sService == null) {
|
if (sService == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user