File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
core/java/android/appwidget Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1919import java .util .ArrayList ;
2020import java .util .HashMap ;
2121
22+ import android .app .ActivityThread ;
2223import android .content .Context ;
2324import android .os .Handler ;
2425import android .os .IBinder ;
@@ -201,12 +202,15 @@ public int allocateAppWidgetId() {
201202 * @return a appWidgetId
202203 * @hide
203204 */
204- public static int allocateAppWidgetIdForHost ( String packageName , int hostId ) {
205+ public static int allocateAppWidgetIdForSystem ( int hostId ) {
205206 checkCallerIsSystem ();
206207 try {
207208 if (sService == null ) {
208209 bindService ();
209210 }
211+ Context systemContext =
212+ (Context ) ActivityThread .currentActivityThread ().getSystemContext ();
213+ String packageName = systemContext .getPackageName ();
210214 return sService .allocateAppWidgetId (packageName , hostId );
211215 } catch (RemoteException e ) {
212216 throw new RuntimeException ("system server dead?" , e );
@@ -240,7 +244,7 @@ public void deleteAppWidgetId(int appWidgetId) {
240244 * Stop listening to changes for this AppWidget.
241245 * @hide
242246 */
243- public static void deleteAppWidgetIdForHost (int appWidgetId ) {
247+ public static void deleteAppWidgetIdForSystem (int appWidgetId ) {
244248 checkCallerIsSystem ();
245249 try {
246250 if (sService == null ) {
You can’t perform that action at this time.
0 commit comments