Allowing AppWidgetService to start without FEATURE_APP_WIDGETS

Bug: 26110877
Change-Id: Ide402274af4067c530793f0d674821f1294c4195
This commit is contained in:
Dmitri Plotnikov
2016-03-25 17:24:57 -07:00
parent 61ad7ad7fd
commit 0a3e17325c
3 changed files with 7 additions and 1 deletions

View File

@@ -2505,4 +2505,8 @@
<!-- True if the device supports at least one form of multi-window.
E.g. freeform, split-screen, picture-in-picture. -->
<bool name="config_supportsMultiWindow">true</bool>
<!-- True if the device requires AppWidgetService even if it does not have
the PackageManager.FEATURE_APP_WIDGETS feature -->
<bool name="config_enableAppWidgetService">false</bool>
</resources>

View File

@@ -307,6 +307,7 @@
<java-symbol type="bool" name="config_supportsMultiWindow" />
<java-symbol type="bool" name="config_guestUserEphemeral" />
<java-symbol type="bool" name="config_localDisplaysMirrorContent" />
<java-symbol type="bool" name="config_enableAppWidgetService" />
<java-symbol type="string" name="config_defaultPictureInPictureBounds" />
<java-symbol type="string" name="config_centeredPictureInPictureBounds" />
<java-symbol type="string" name="config_pictureInPictureBoundsInRecents" />

View File

@@ -1023,7 +1023,8 @@ public final class SystemServer {
mSystemServiceManager.startService(BACKUP_MANAGER_SERVICE_CLASS);
}
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_APP_WIDGETS)) {
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_APP_WIDGETS)
|| context.getResources().getBoolean(R.bool.config_enableAppWidgetService)) {
mSystemServiceManager.startService(APPWIDGET_SERVICE_CLASS);
}