| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package com.android.server; |
| 18 |
|
| 19 |
import android.annotation.Nullable; |
| 20 |
|
| 21 |
import java.util.List; |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
public class AppWidgetBackupBridge { |
| 30 |
private static WidgetBackupProvider sAppWidgetService; |
| 31 |
|
| 32 |
public static void register(WidgetBackupProvider instance) { |
| 33 |
sAppWidgetService = instance; |
| 34 |
} |
| 35 |
|
| 36 |
public static List<String> getWidgetParticipants(int userId) { |
| 37 |
return (sAppWidgetService != null) |
| 38 |
? sAppWidgetService.getWidgetParticipants(userId) |
| 39 |
: null; |
| 40 |
} |
| 41 |
|
| 42 |
|
| 43 |
@Nullable |
| 44 |
public static byte[] getWidgetState(String packageName, int userId) { |
| 45 |
return (sAppWidgetService != null) |
| 46 |
? sAppWidgetService.getWidgetState(packageName, userId) |
| 47 |
: null; |
| 48 |
} |
| 49 |
|
| 50 |
public static void systemRestoreStarting(int userId) { |
| 51 |
if (sAppWidgetService != null) { |
| 52 |
sAppWidgetService.systemRestoreStarting(userId); |
| 53 |
} |
| 54 |
} |
| 55 |
|
| 56 |
public static void restoreWidgetState(String packageName, byte[] restoredState, int userId) { |
| 57 |
if (sAppWidgetService != null) { |
| 58 |
sAppWidgetService.restoreWidgetState(packageName, restoredState, userId); |
| 59 |
} |
| 60 |
} |
| 61 |
|
| 62 |
public static void systemRestoreFinished(int userId) { |
| 63 |
if (sAppWidgetService != null) { |
| 64 |
sAppWidgetService.systemRestoreFinished(userId); |
| 65 |
} |
| 66 |
} |
| 67 |
} |