This commit is contained in:
committed by
Android (Google) Code Review
commit
b685faa2ce
@@ -6726,6 +6726,7 @@ package android.content.pm {
|
|||||||
field public static final int DONT_KILL_APP = 1; // 0x1
|
field public static final int DONT_KILL_APP = 1; // 0x1
|
||||||
field public static final java.lang.String EXTRA_VERIFICATION_ID = "android.content.pm.extra.VERIFICATION_ID";
|
field public static final java.lang.String EXTRA_VERIFICATION_ID = "android.content.pm.extra.VERIFICATION_ID";
|
||||||
field public static final java.lang.String EXTRA_VERIFICATION_RESULT = "android.content.pm.extra.VERIFICATION_RESULT";
|
field public static final java.lang.String EXTRA_VERIFICATION_RESULT = "android.content.pm.extra.VERIFICATION_RESULT";
|
||||||
|
field public static final java.lang.String FEATURE_APP_WIDGETS = "android.software.app_widgets";
|
||||||
field public static final java.lang.String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency";
|
field public static final java.lang.String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency";
|
||||||
field public static final java.lang.String FEATURE_BLUETOOTH = "android.hardware.bluetooth";
|
field public static final java.lang.String FEATURE_BLUETOOTH = "android.hardware.bluetooth";
|
||||||
field public static final java.lang.String FEATURE_CAMERA = "android.hardware.camera";
|
field public static final java.lang.String FEATURE_CAMERA = "android.hardware.camera";
|
||||||
@@ -6736,6 +6737,8 @@ package android.content.pm {
|
|||||||
field public static final java.lang.String FEATURE_FAKETOUCH = "android.hardware.faketouch";
|
field public static final java.lang.String FEATURE_FAKETOUCH = "android.hardware.faketouch";
|
||||||
field public static final java.lang.String FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT = "android.hardware.faketouch.multitouch.distinct";
|
field public static final java.lang.String FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT = "android.hardware.faketouch.multitouch.distinct";
|
||||||
field public static final java.lang.String FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND = "android.hardware.faketouch.multitouch.jazzhand";
|
field public static final java.lang.String FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND = "android.hardware.faketouch.multitouch.jazzhand";
|
||||||
|
field public static final java.lang.String FEATURE_HOME_SCREEN = "android.software.home_screen";
|
||||||
|
field public static final java.lang.String FEATURE_INPUT_METHODS = "android.software.input_methods";
|
||||||
field public static final java.lang.String FEATURE_LIVE_WALLPAPER = "android.software.live_wallpaper";
|
field public static final java.lang.String FEATURE_LIVE_WALLPAPER = "android.software.live_wallpaper";
|
||||||
field public static final java.lang.String FEATURE_LOCATION = "android.hardware.location";
|
field public static final java.lang.String FEATURE_LOCATION = "android.hardware.location";
|
||||||
field public static final java.lang.String FEATURE_LOCATION_GPS = "android.hardware.location.gps";
|
field public static final java.lang.String FEATURE_LOCATION_GPS = "android.hardware.location.gps";
|
||||||
|
|||||||
@@ -1143,6 +1143,29 @@ public abstract class PackageManager {
|
|||||||
@SdkConstant(SdkConstantType.FEATURE)
|
@SdkConstant(SdkConstantType.FEATURE)
|
||||||
public static final String FEATURE_LIVE_WALLPAPER = "android.software.live_wallpaper";
|
public static final String FEATURE_LIVE_WALLPAPER = "android.software.live_wallpaper";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Feature for {@link #getSystemAvailableFeatures} and
|
||||||
|
* {@link #hasSystemFeature}: The device supports app widgets.
|
||||||
|
*/
|
||||||
|
@SdkConstant(SdkConstantType.FEATURE)
|
||||||
|
public static final String FEATURE_APP_WIDGETS = "android.software.app_widgets";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Feature for {@link #getSystemAvailableFeatures} and
|
||||||
|
* {@link #hasSystemFeature}: The device supports a home screen that is replaceable
|
||||||
|
* by third party applications.
|
||||||
|
*/
|
||||||
|
@SdkConstant(SdkConstantType.FEATURE)
|
||||||
|
public static final String FEATURE_HOME_SCREEN = "android.software.home_screen";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Feature for {@link #getSystemAvailableFeatures} and
|
||||||
|
* {@link #hasSystemFeature}: The device supports adding new input methods implemented
|
||||||
|
* with the {@link android.inputmethodservice.InputMethodService} API.
|
||||||
|
*/
|
||||||
|
@SdkConstant(SdkConstantType.FEATURE)
|
||||||
|
public static final String FEATURE_INPUT_METHODS = "android.software.input_methods";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Feature for {@link #getSystemAvailableFeatures} and
|
* Feature for {@link #getSystemAvailableFeatures} and
|
||||||
* {@link #hasSystemFeature}: The device supports WiFi (802.11) networking.
|
* {@link #hasSystemFeature}: The device supports WiFi (802.11) networking.
|
||||||
|
|||||||
@@ -177,18 +177,20 @@ class AppWidgetServiceImpl {
|
|||||||
// Manages persistent references to RemoteViewsServices from different App Widgets
|
// Manages persistent references to RemoteViewsServices from different App Widgets
|
||||||
private final HashMap<FilterComparison, HashSet<Integer>> mRemoteViewsServicesAppWidgets = new HashMap<FilterComparison, HashSet<Integer>>();
|
private final HashMap<FilterComparison, HashSet<Integer>> mRemoteViewsServicesAppWidgets = new HashMap<FilterComparison, HashSet<Integer>>();
|
||||||
|
|
||||||
Context mContext;
|
final Context mContext;
|
||||||
|
final IPackageManager mPm;
|
||||||
|
final AlarmManager mAlarmManager;
|
||||||
|
final ArrayList<Provider> mInstalledProviders = new ArrayList<Provider>();
|
||||||
|
final int mUserId;
|
||||||
|
final boolean mHasFeature;
|
||||||
|
|
||||||
Locale mLocale;
|
Locale mLocale;
|
||||||
IPackageManager mPm;
|
|
||||||
AlarmManager mAlarmManager;
|
|
||||||
ArrayList<Provider> mInstalledProviders = new ArrayList<Provider>();
|
|
||||||
int mNextAppWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID + 1;
|
int mNextAppWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID + 1;
|
||||||
final ArrayList<AppWidgetId> mAppWidgetIds = new ArrayList<AppWidgetId>();
|
final ArrayList<AppWidgetId> mAppWidgetIds = new ArrayList<AppWidgetId>();
|
||||||
ArrayList<Host> mHosts = new ArrayList<Host>();
|
final ArrayList<Host> mHosts = new ArrayList<Host>();
|
||||||
// set of package names
|
// set of package names
|
||||||
HashSet<String> mPackagesWithBindWidgetPermission = new HashSet<String>();
|
final HashSet<String> mPackagesWithBindWidgetPermission = new HashSet<String>();
|
||||||
boolean mSafeMode;
|
boolean mSafeMode;
|
||||||
int mUserId;
|
|
||||||
boolean mStateLoaded;
|
boolean mStateLoaded;
|
||||||
int mMaxWidgetBitmapMemory;
|
int mMaxWidgetBitmapMemory;
|
||||||
|
|
||||||
@@ -204,6 +206,8 @@ class AppWidgetServiceImpl {
|
|||||||
mAlarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);
|
mAlarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);
|
||||||
mUserId = userId;
|
mUserId = userId;
|
||||||
mSaveStateHandler = saveStateHandler;
|
mSaveStateHandler = saveStateHandler;
|
||||||
|
mHasFeature = context.getPackageManager().hasSystemFeature(
|
||||||
|
PackageManager.FEATURE_APP_WIDGETS);
|
||||||
computeMaximumWidgetBitmapMemory();
|
computeMaximumWidgetBitmapMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -426,6 +430,9 @@ class AppWidgetServiceImpl {
|
|||||||
|
|
||||||
private void ensureStateLoadedLocked() {
|
private void ensureStateLoadedLocked() {
|
||||||
if (!mStateLoaded) {
|
if (!mStateLoaded) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
loadAppWidgetListLocked();
|
loadAppWidgetListLocked();
|
||||||
loadStateLocked();
|
loadStateLocked();
|
||||||
mStateLoaded = true;
|
mStateLoaded = true;
|
||||||
@@ -435,6 +442,9 @@ class AppWidgetServiceImpl {
|
|||||||
public int allocateAppWidgetId(String packageName, int hostId) {
|
public int allocateAppWidgetId(String packageName, int hostId) {
|
||||||
int callingUid = enforceSystemOrCallingUid(packageName);
|
int callingUid = enforceSystemOrCallingUid(packageName);
|
||||||
synchronized (mAppWidgetIds) {
|
synchronized (mAppWidgetIds) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
ensureStateLoadedLocked();
|
ensureStateLoadedLocked();
|
||||||
int appWidgetId = mNextAppWidgetId++;
|
int appWidgetId = mNextAppWidgetId++;
|
||||||
|
|
||||||
@@ -456,6 +466,9 @@ class AppWidgetServiceImpl {
|
|||||||
|
|
||||||
public void deleteAppWidgetId(int appWidgetId) {
|
public void deleteAppWidgetId(int appWidgetId) {
|
||||||
synchronized (mAppWidgetIds) {
|
synchronized (mAppWidgetIds) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
ensureStateLoadedLocked();
|
ensureStateLoadedLocked();
|
||||||
AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
|
AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
@@ -467,6 +480,9 @@ class AppWidgetServiceImpl {
|
|||||||
|
|
||||||
public void deleteHost(int hostId) {
|
public void deleteHost(int hostId) {
|
||||||
synchronized (mAppWidgetIds) {
|
synchronized (mAppWidgetIds) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
ensureStateLoadedLocked();
|
ensureStateLoadedLocked();
|
||||||
int callingUid = Binder.getCallingUid();
|
int callingUid = Binder.getCallingUid();
|
||||||
Host host = lookupHostLocked(callingUid, hostId);
|
Host host = lookupHostLocked(callingUid, hostId);
|
||||||
@@ -479,6 +495,9 @@ class AppWidgetServiceImpl {
|
|||||||
|
|
||||||
public void deleteAllHosts() {
|
public void deleteAllHosts() {
|
||||||
synchronized (mAppWidgetIds) {
|
synchronized (mAppWidgetIds) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
ensureStateLoadedLocked();
|
ensureStateLoadedLocked();
|
||||||
int callingUid = Binder.getCallingUid();
|
int callingUid = Binder.getCallingUid();
|
||||||
final int N = mHosts.size();
|
final int N = mHosts.size();
|
||||||
@@ -561,6 +580,9 @@ class AppWidgetServiceImpl {
|
|||||||
final long ident = Binder.clearCallingIdentity();
|
final long ident = Binder.clearCallingIdentity();
|
||||||
try {
|
try {
|
||||||
synchronized (mAppWidgetIds) {
|
synchronized (mAppWidgetIds) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
options = cloneIfLocalBinder(options);
|
options = cloneIfLocalBinder(options);
|
||||||
ensureStateLoadedLocked();
|
ensureStateLoadedLocked();
|
||||||
AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
|
AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
|
||||||
@@ -622,6 +644,9 @@ class AppWidgetServiceImpl {
|
|||||||
|
|
||||||
public boolean bindAppWidgetIdIfAllowed(
|
public boolean bindAppWidgetIdIfAllowed(
|
||||||
String packageName, int appWidgetId, ComponentName provider, Bundle options) {
|
String packageName, int appWidgetId, ComponentName provider, Bundle options) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BIND_APPWIDGET, null);
|
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BIND_APPWIDGET, null);
|
||||||
} catch (SecurityException se) {
|
} catch (SecurityException se) {
|
||||||
@@ -649,6 +674,9 @@ class AppWidgetServiceImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasBindAppWidgetPermission(String packageName) {
|
public boolean hasBindAppWidgetPermission(String packageName) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
mContext.enforceCallingPermission(
|
mContext.enforceCallingPermission(
|
||||||
android.Manifest.permission.MODIFY_APPWIDGET_BIND_PERMISSIONS,
|
android.Manifest.permission.MODIFY_APPWIDGET_BIND_PERMISSIONS,
|
||||||
"hasBindAppWidgetPermission packageName=" + packageName);
|
"hasBindAppWidgetPermission packageName=" + packageName);
|
||||||
@@ -660,6 +688,9 @@ class AppWidgetServiceImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setBindAppWidgetPermission(String packageName, boolean permission) {
|
public void setBindAppWidgetPermission(String packageName, boolean permission) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
mContext.enforceCallingPermission(
|
mContext.enforceCallingPermission(
|
||||||
android.Manifest.permission.MODIFY_APPWIDGET_BIND_PERMISSIONS,
|
android.Manifest.permission.MODIFY_APPWIDGET_BIND_PERMISSIONS,
|
||||||
"setBindAppWidgetPermission packageName=" + packageName);
|
"setBindAppWidgetPermission packageName=" + packageName);
|
||||||
@@ -678,6 +709,9 @@ class AppWidgetServiceImpl {
|
|||||||
// Binds to a specific RemoteViewsService
|
// Binds to a specific RemoteViewsService
|
||||||
public void bindRemoteViewsService(int appWidgetId, Intent intent, IBinder connection) {
|
public void bindRemoteViewsService(int appWidgetId, Intent intent, IBinder connection) {
|
||||||
synchronized (mAppWidgetIds) {
|
synchronized (mAppWidgetIds) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
ensureStateLoadedLocked();
|
ensureStateLoadedLocked();
|
||||||
AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
|
AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
@@ -735,6 +769,9 @@ class AppWidgetServiceImpl {
|
|||||||
// Unbinds from a specific RemoteViewsService
|
// Unbinds from a specific RemoteViewsService
|
||||||
public void unbindRemoteViewsService(int appWidgetId, Intent intent) {
|
public void unbindRemoteViewsService(int appWidgetId, Intent intent) {
|
||||||
synchronized (mAppWidgetIds) {
|
synchronized (mAppWidgetIds) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
ensureStateLoadedLocked();
|
ensureStateLoadedLocked();
|
||||||
// Unbind from the RemoteViewsService (which will trigger a callback to the bound
|
// Unbind from the RemoteViewsService (which will trigger a callback to the bound
|
||||||
// RemoteViewsAdapter)
|
// RemoteViewsAdapter)
|
||||||
@@ -846,6 +883,9 @@ class AppWidgetServiceImpl {
|
|||||||
|
|
||||||
public AppWidgetProviderInfo getAppWidgetInfo(int appWidgetId) {
|
public AppWidgetProviderInfo getAppWidgetInfo(int appWidgetId) {
|
||||||
synchronized (mAppWidgetIds) {
|
synchronized (mAppWidgetIds) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
ensureStateLoadedLocked();
|
ensureStateLoadedLocked();
|
||||||
AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
|
AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
|
||||||
if (id != null && id.provider != null && !id.provider.zombie) {
|
if (id != null && id.provider != null && !id.provider.zombie) {
|
||||||
@@ -858,6 +898,9 @@ class AppWidgetServiceImpl {
|
|||||||
public RemoteViews getAppWidgetViews(int appWidgetId) {
|
public RemoteViews getAppWidgetViews(int appWidgetId) {
|
||||||
if (DBG) log("getAppWidgetViews id=" + appWidgetId);
|
if (DBG) log("getAppWidgetViews id=" + appWidgetId);
|
||||||
synchronized (mAppWidgetIds) {
|
synchronized (mAppWidgetIds) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
ensureStateLoadedLocked();
|
ensureStateLoadedLocked();
|
||||||
AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
|
AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
@@ -870,6 +913,9 @@ class AppWidgetServiceImpl {
|
|||||||
|
|
||||||
public List<AppWidgetProviderInfo> getInstalledProviders(int categoryFilter) {
|
public List<AppWidgetProviderInfo> getInstalledProviders(int categoryFilter) {
|
||||||
synchronized (mAppWidgetIds) {
|
synchronized (mAppWidgetIds) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return new ArrayList<AppWidgetProviderInfo>(0);
|
||||||
|
}
|
||||||
ensureStateLoadedLocked();
|
ensureStateLoadedLocked();
|
||||||
final int N = mInstalledProviders.size();
|
final int N = mInstalledProviders.size();
|
||||||
ArrayList<AppWidgetProviderInfo> result = new ArrayList<AppWidgetProviderInfo>(N);
|
ArrayList<AppWidgetProviderInfo> result = new ArrayList<AppWidgetProviderInfo>(N);
|
||||||
@@ -884,6 +930,9 @@ class AppWidgetServiceImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateAppWidgetIds(int[] appWidgetIds, RemoteViews views) {
|
public void updateAppWidgetIds(int[] appWidgetIds, RemoteViews views) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (appWidgetIds == null) {
|
if (appWidgetIds == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -929,6 +978,9 @@ class AppWidgetServiceImpl {
|
|||||||
|
|
||||||
public void updateAppWidgetOptions(int appWidgetId, Bundle options) {
|
public void updateAppWidgetOptions(int appWidgetId, Bundle options) {
|
||||||
synchronized (mAppWidgetIds) {
|
synchronized (mAppWidgetIds) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
options = cloneIfLocalBinder(options);
|
options = cloneIfLocalBinder(options);
|
||||||
ensureStateLoadedLocked();
|
ensureStateLoadedLocked();
|
||||||
AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
|
AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
|
||||||
@@ -953,6 +1005,9 @@ class AppWidgetServiceImpl {
|
|||||||
|
|
||||||
public Bundle getAppWidgetOptions(int appWidgetId) {
|
public Bundle getAppWidgetOptions(int appWidgetId) {
|
||||||
synchronized (mAppWidgetIds) {
|
synchronized (mAppWidgetIds) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return Bundle.EMPTY;
|
||||||
|
}
|
||||||
ensureStateLoadedLocked();
|
ensureStateLoadedLocked();
|
||||||
AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
|
AppWidgetId id = lookupAppWidgetIdLocked(appWidgetId);
|
||||||
if (id != null && id.options != null) {
|
if (id != null && id.options != null) {
|
||||||
@@ -964,6 +1019,9 @@ class AppWidgetServiceImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void partiallyUpdateAppWidgetIds(int[] appWidgetIds, RemoteViews views) {
|
public void partiallyUpdateAppWidgetIds(int[] appWidgetIds, RemoteViews views) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (appWidgetIds == null) {
|
if (appWidgetIds == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -987,6 +1045,9 @@ class AppWidgetServiceImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void notifyAppWidgetViewDataChanged(int[] appWidgetIds, int viewId) {
|
public void notifyAppWidgetViewDataChanged(int[] appWidgetIds, int viewId) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (appWidgetIds == null) {
|
if (appWidgetIds == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1005,6 +1066,9 @@ class AppWidgetServiceImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateAppWidgetProvider(ComponentName provider, RemoteViews views) {
|
public void updateAppWidgetProvider(ComponentName provider, RemoteViews views) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
synchronized (mAppWidgetIds) {
|
synchronized (mAppWidgetIds) {
|
||||||
ensureStateLoadedLocked();
|
ensureStateLoadedLocked();
|
||||||
Provider p = lookupProviderLocked(provider);
|
Provider p = lookupProviderLocked(provider);
|
||||||
@@ -1147,6 +1211,9 @@ class AppWidgetServiceImpl {
|
|||||||
|
|
||||||
public int[] startListening(IAppWidgetHost callbacks, String packageName, int hostId,
|
public int[] startListening(IAppWidgetHost callbacks, String packageName, int hostId,
|
||||||
List<RemoteViews> updatedViews) {
|
List<RemoteViews> updatedViews) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return new int[0];
|
||||||
|
}
|
||||||
int callingUid = enforceCallingUid(packageName);
|
int callingUid = enforceCallingUid(packageName);
|
||||||
synchronized (mAppWidgetIds) {
|
synchronized (mAppWidgetIds) {
|
||||||
ensureStateLoadedLocked();
|
ensureStateLoadedLocked();
|
||||||
@@ -1169,6 +1236,9 @@ class AppWidgetServiceImpl {
|
|||||||
|
|
||||||
public void stopListening(int hostId) {
|
public void stopListening(int hostId) {
|
||||||
synchronized (mAppWidgetIds) {
|
synchronized (mAppWidgetIds) {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
ensureStateLoadedLocked();
|
ensureStateLoadedLocked();
|
||||||
Host host = lookupHostLocked(Binder.getCallingUid(), hostId);
|
Host host = lookupHostLocked(Binder.getCallingUid(), hostId);
|
||||||
if (host != null) {
|
if (host != null) {
|
||||||
@@ -1558,6 +1628,9 @@ class AppWidgetServiceImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void saveStateLocked() {
|
void saveStateLocked() {
|
||||||
|
if (!mHasFeature) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
AtomicFile file = savedStateFile();
|
AtomicFile file = savedStateFile();
|
||||||
FileOutputStream stream;
|
FileOutputStream stream;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
final SettingsObserver mSettingsObserver;
|
final SettingsObserver mSettingsObserver;
|
||||||
final IWindowManager mIWindowManager;
|
final IWindowManager mIWindowManager;
|
||||||
final HandlerCaller mCaller;
|
final HandlerCaller mCaller;
|
||||||
|
final boolean mHasFeature;
|
||||||
private InputMethodFileManager mFileManager;
|
private InputMethodFileManager mFileManager;
|
||||||
private InputMethodAndSubtypeListManager mImListManager;
|
private InputMethodAndSubtypeListManager mImListManager;
|
||||||
private final HardKeyboardListener mHardKeyboardListener;
|
private final HardKeyboardListener mHardKeyboardListener;
|
||||||
@@ -608,6 +609,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
}, true /*asyncHandler*/);
|
}, true /*asyncHandler*/);
|
||||||
mWindowManagerService = windowManager;
|
mWindowManagerService = windowManager;
|
||||||
mHardKeyboardListener = new HardKeyboardListener();
|
mHardKeyboardListener = new HardKeyboardListener();
|
||||||
|
mHasFeature = context.getPackageManager().hasSystemFeature(
|
||||||
|
PackageManager.FEATURE_INPUT_METHODS);
|
||||||
|
|
||||||
mImeSwitcherNotification = new Notification();
|
mImeSwitcherNotification = new Notification();
|
||||||
mImeSwitcherNotification.icon = com.android.internal.R.drawable.ic_notification_ime_default;
|
mImeSwitcherNotification.icon = com.android.internal.R.drawable.ic_notification_ime_default;
|
||||||
|
|||||||
Reference in New Issue
Block a user