summaryrefslogtreecommitdiffstats
path: root/services/appwidget
Commit message (Collapse)AuthorAgeFilesLines
* Also dump widget options in 'dumpsys appwidget'.Danny Baumann2015-10-251-0/+3
| | | | Change-Id: Ia002c4b93d453ecb94be9312371ec71853a9774b
* Always call onProvidersChanged() when packages containing widgets are updated.Winson2015-08-111-1/+1
| | | | | | | | | | | - In the existing logic, the call to onProvidersChanged() is called when a package with widgets is added or removed, but only called when a package is updated _and_ there is an app widget bound to a host. This differs from what the expected behavior is based on the documentation and means that packages with widgets that update have no way of notifying host apps of changes except via package events. Bug: 20698931 Change-Id: I60af36d51e99ca1ea751d9d9d03a50ef2d5bef98
* GetInstalledProvidersForProfiles should never return null object.Hyunyoung Song2015-06-181-4/+1
| | | | | | | b/21916365 b/19904873 Change-Id: I296cafd15a185ad91cb7491bd6d2466ac03cdfb7
* AppWidgetServiceImpl should use ParceledListSlice as return objectHyunyoung Song2015-06-171-2/+3
| | | | | | | | | b/19904873 > Reason: to prevent TransactionTooLargeException from occuring when binder transaction size goes over the limit. Change-Id: I054cb161d235234f3ccdaadd70314163e690b0db
* Pass charset to XmlPullParser.setInput instead of nullWojciech Staszkiewicz2015-05-141-4/+5
| | | | | | | | | Passing null to XmlPullParser.setInput forces it to do additional work, which can be easily avoided if we know the charset beforehand. bug: b/20849543 Change-Id: Iaff97be9df2d0f99d7af8f19f65934439c9658e2
* Exclude bound app widgets from idle app listAmith Yamasani2015-05-011-10/+100
| | | | | | | | Track package names of bound app widgets and use the list when querying for idle apps. Bug: 20066058 Change-Id: If8039397a061ef04bb13aa38d57cd7f0221f5fc7
* Update use of procstate for services.Dianne Hackborn2015-04-291-2/+4
| | | | | | | | | | | | | | | | | | | | Now that we have a separate foreground service proc state (above a sleeping top app), update various system services to put their bindings into this state when appropriate. There are two new bind flags for this -- one that just always makes it a foreground service, another that only does it when the device is awake (useful for things like the wallpaper). And with all of that, tweak network policy manager to only include apps that are at least foreground service state when in power save and device idle modes. This will allow us to further reduce the set of apps that have network access (in particular not giving access to the current top app when the screen is off), hopefully leading to even better battery life. Change-Id: I91d85a5c5ed64e856149e9a5d94a634a7925ec7f
* Add a mechanism to make pending intents immutable.Svetoslav2015-04-101-4/+7
| | | | | | bug:19618745 Change-Id: Ice742e0162cb9b7c0afbc32e0eea03d501666e2b
* Remove widgets for packages no longer whitelisted by adminKenny Guy2015-02-171-5/+27
| | | | | | | | When cross profile widget whitelist is updated by device admin remove providers for removed packages. Bug: 19293923 Change-Id: I7a5f7b706486055346d906c89d48510bfe1ad352
* Restored widget provider id not properly updated.Svetoslav2014-10-081-2/+3
| | | | | | | | | | | | | During restore first the provider records and then the applications are restored. Therefore, we keep the restored provider records in a zombie state and once we get the package install broadcasts from the package manager we update the zombie providers to be real ones. The bug was that while doing this we were not updating the provider id from one with an undefined UID to the one with the UID under which its package now runs. bug:17869323 Change-Id: I20b7cbfd2f90e2f5bf3a6b858d8da99cc1c82841
* Load shared library dependencies for AppWidgetsAdam Lesinski2014-10-071-1/+7
| | | | | | | | | | PackageManager and AppWidgetHostServiceImpl should be loading the resources of any shared libraries being used by the app, as they have references in their Widgets or application icons/labels, etc. Bug:17668152 Change-Id: I359662334edb125d7570089916727df4eeba02bb
* Fix a bug in parsing app widget state XML.Svetoslav2014-09-221-0/+16
| | | | | | | | | | | | | | | | | | When restoring app widget state from XML we read all providers, hosts, and widgets and only after reading all hosts and providers for all members of the group we hookup the widgets as they may cross profile boundary. To esntablish the host-widget and provider- widget relation we use a tag for the host and the provider that are assigned before saving the state to XML. When restoring we are using the tags to match widgets with hosts and providers. The bug was that we were not clearing the tag of all hosts and providers before reading from XML as we want the only tags that are defined to be the ones we are reading. This resulted in wrong app widget restore for a secondary user. bug:17505027 Change-Id: I035d8f13142c6b9dbc9d658b82390f9cd8d75e0d
* Merge "AppWidgetServiceImpl: Use enforceCallingOrSelfPermission for checking ↵Nick Kralevich2014-09-041-7/+5
|\ | | | | | | DUMP" into lmp-dev
| * AppWidgetServiceImpl: Use enforceCallingOrSelfPermission for checking DUMPNick Kralevich2014-09-041-6/+4
| | | | | | | | | | | | | | | | | | | | Use enforceCallingOrSelfPermission() for throwing a security exception rather than creating the security exception ourselves. This has the advantage that the exception is in a well known format expected by the CTS test android.security.cts.ServicePermissionsTest#testDumpProtected Bug: 17165920 Change-Id: I7d3c2d2a0852a490fe1d553cd81d1efc79d2fec3
* | Fix collection iteration index.Svetoslav2014-09-041-1/+1
|/ | | | | | bug:17387880 Change-Id: Ic637ce8fa2da87d6f21a222bd70bf627953f57e3
* RemoteViews service not unbound.Svet Ganov2014-08-241-20/+7
| | | | | | | | | | | | | | | | | | | | We are checking whether an app can access an app widget based on the calling uid and the package name. The package is mostly to make sure that hosts in different apps do not accidentally interfere whereas the security is enforced by the uid. When remote views adapter binds and unbinds to a remote views serivce it was passing the package of the context we create to load resources for the widget instead the package of the host. Now it is passing the host package and also we are checking if the caller of bind remove serivce API is in uid that has the host package - this makes it consistent with elsewhere. bug:17226052 Change-Id: I2b0b6669e3dc027037b7481c2871cedabd642433
* Fix a regression in partially updading app widgets.Svet Ganov2014-08-211-3/+3
| | | | | | | | | | | | | App widgets can be partially updated where only the actions delta is delivered to the client. There was a regression where instead of sending the delta, the merged remote views were sent. This was problematic because certain actions are ignored when merging to avoid clutter (specifically showNext and showPrevious), hence these actions never reached the client. bug:16844814 Change-Id: I88ab58e610cda24154985165e6d6d93a1baa9c79
* Notify app widget hosts when cross-profile providers change.Svet Ganov2014-08-201-3/+73
| | | | | | | | | | | | 1. Notify the hosts in the group if a package gets white-listed or un-white-listed for providing widgets across profiles. 2. Notify hosts in the group for provider changes when a profile is deleted. bug:17126070 Change-Id: Ic719c1c68e45842d50decc95603f1d61583b8f02
* Remove system_server classes from the boot image.Narayan Kamath2014-08-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | We set the system_server classpath in the environment (like we do with BOOTCLASSPATH). After the zygote forks the system_server, we dexopt the classpath (if needed) and then launch the system server with the correct PathClassLoader. This needed several small / medium refactorings : - The logic for connecting to installd is now in a separate class and belongs in the system_server. - SystemService / SystemServiceManager have now moved to classes.jar. They are only used from there, and since they use Class.forName, we want them to be loaded by the system_server classloader, and not the bootclassloader. - BootReceiver now moves to frameworks.jar, because it is used by ActivityThread and friends. bug: 16555230 Change-Id: Ic84f0b2baf611eeedff6d123cb7191bb0259e600
* Polish the new cross-profile app widget APIsSvetoslav2014-08-081-113/+23
| | | | | | bug:14991269 Change-Id: I5996f8c69a3d151ff1ecd8f19403dd606f588150
* Fix cross-user talk.Svetoslav2014-08-071-10/+7
| | | | | | | | | | | | An app can access widgets hosted or provided by its uid and package. Access is also allowed if the caller has the bind app widgets permission but this caller can be in the wrong user. Now the caller should not only have the bind app widget permission but also be in the same user as the host or the provider of the widget. bug:16834230 Change-Id: I5ddb6309f63f2b4ba95360446c2b9584350fb66f
* Polish of the app widgets cross-profiles feature.Svetoslav2014-08-071-4/+7
| | | | | | | | | | | | | | | | | | | | 1. Added API for badging an arbitrary drawable at a given location. 2. Updated the icon and previewImage deprecation as they are no longer returning a badged drawable. The methods to load the icon and the preview are now just making it easier for a developer to get the drawables. 3. Fixed a bug in AppWidgetServiceImpl leading to a crash when a user is removed. 4. Fixed a bug in AppWidgetHost which was unnecessarily caching its package name and having code paths where the cached value was not populated when calling into the system. bug:14991269 Change-Id: I50d011a6597d88814715d5ec04ee67815e8ce0bd
* Allow adding widgets from user profiles.Svetoslav2014-08-052-2257/+3147
| | | | | | | | | | | | | The goal of this change is to enable support for appwidget from user profiles to the user main profile. A user profile is a user which is associated as a child of the main user profile. For example, a user may have a personal (parent) and corporate (child) profile. The device policy should be able to control whether adding a widget from a child profile and given packages is allowed. This change assumes that all packages from managed profiles are white listed. Another change will add the device policy changes. Change-Id: I267260b55d74c48b112a29979a9f59eef7a8194e
* Fix security issue in bindRemoteViewsServiceAdam Cohen2014-05-271-0/+9
| | | | | | | | | -> Enforce that the passed intent's component belongs to the same package as the passed AppWidget id. issue 15287902 Change-Id: Ic85c38d399fe1cbb6f7efa844ae0f5367a1906ed
* Bump up priority of system receiving BOOT_COMPLETED.Dianne Hackborn2014-05-021-2/+3
| | | | Change-Id: I5166f88f11f781914312e867cb653c8ecbefa705
* Track package change.Elliott Hughes2014-04-241-2/+1
| | | | Change-Id: I6a8123d8e69367fc1ce27bac46c4bcec489d73ba
* Unlinked providers STILL shouldn't cause crashesChristopher Tate2014-03-271-1/+2
| | | | | | Bug 13651057 Change-Id: Id7e5ba521ac3f201b1a44f122358ca5af2929e06
* Don't crash when handling unlinked widget bindingsChristopher Tate2014-03-261-1/+1
| | | | | | | | | A host can have an 'instance' the other end of which is still unlinked to a concrete provider. Don't crash when we hit those. Bug 13651057 Change-Id: I5a29afb0e6a7ab30976862aee04bd33f609543fa
* App widget backup/restore infrastructureChristopher Tate2014-03-202-45/+759
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backup/restore now supports app widgets. An application involved with app widgets, either hosting or publishing, now has associated data in its backup dataset related to the state of widget instantiation on the ancestral device. That data is processed by the OS during restore so that the matching widget instances can be "automatically" regenerated. To take advantage of this facility, widget-using apps need to do two things: first, implement a backup agent and store whatever widget state they need to properly deal with them post-restore (e.g. the widget instance size & location, for a host); and second, implement handlers for new AppWidgetManager broadcasts that describe how to translate ancestral-dataset widget id numbers to the post-restore world. Note that a host or provider doesn't technically need to store *any* data on its own via its agent; it just needs to opt in to the backup/restore process by publishing an agent. The OS will then store a small amount of data on behalf of each widget-savvy app within the backup dataset, and act on that data at restore time. The broadcasts are AppWidgetManager.ACTION_APPWIDGET_RESTORED and ACTION_APPWIDGET_HOST_RESTORED, and have three associated extras: EXTRA_APPWIDGET_OLD_IDS EXTRA_APPWIDGET_IDS EXTRA_HOST_ID [for the host-side broadcast] The first two are same-sized arrays of integer widget IDs. The _OLD_IDS values are the widget IDs as known to the ancestral device. The _IDS array holds the corresponding widget IDs in the new post- restore environment. The app should simply update the stored widget IDs in its bookkeeping to the new values, and things are off and running. The HOST_ID extra, as one might expect, is the app-defined host ID value of the particular host instance which has just been restored. The broadcasts are sent following the conclusion of the overall restore pass. This is because the restore might have occurred in a tightly restricted lifecycle environment without content providers or the package's custom Application class. The _RESTORED broadcast, however, is always delivered into a normal application environment, so that the app can use its content provider etc as expected. *All* widget instances that were processed over the course of the system restore are indicated in the _RESTORED broadcast, even if the backing provider or host is not yet installed. The widget participant is responsible for understanding that these are promises that might be fulfilled later rather than necessarily reflecting the immediate presentable widget state. (Remember that following a cloud restore, apps may be installed piecemeal over a lengthy period of time.) Telling the hosts up front about all intended widget instances allows them to show placeholder UI or similarly useful information rather than surprising the user with piecemeal unexpected appearances. The AppWidgetProvider helper class has been updated to add a new callback, onRestored(...), invoked when the _RESTORED broadcast is received. The call to onRestored() is immediately followed by an invocation of onUpdate() for the affected widgets because they will need to have their RemoteViews regenerated under the new ID values. Bug 10622506 Bug 10707117 Change-Id: Ie0007cdf809600b880d91989c00c3c3b8a4f988b
* am 25df673b: am 1b51c9cb: Merge "Make SystemService constructor take a ↵Jeff Brown2014-02-111-5/+5
|\ | | | | | | | | | | | | Context." into klp-modular-dev * commit '25df673b849de374cf1de40250dfd8a48b7ac28b': Make SystemService constructor take a Context.
| * Make SystemService constructor take a Context.Jeff Brown2014-02-101-5/+5
| | | | | | | | | | | | | | | | | | | | This change simplifies the process of initializing a SystemService by folding the onCreate() step back into the constructor. It removes some ambuiguity about what work should happen in the constructor and should make it possible for services to retain most of their final fields after refactoring into the new pattern. Change-Id: I25f41af0321bc01898658ab44b369f9c5d16800b
* | am a5a93f55: am 7f416631: Merge "Check feature bits before loading optional ↵Adam Lesinski2014-02-062-11/+10
|\ \ | |/ | | | | | | | | | | services" into klp-modular-dev * commit 'a5a93f559d337ad5b79716b05ea43707eb779dc8': Check feature bits before loading optional services
| * Check feature bits before loading optional servicesAdam Lesinski2014-02-052-11/+10
| | | | | | | | | | | | | | | | At startup, we check with PackageManager whether a system service is available before attempting to load it. A system service is available if its associated feature (similar to hardware features) is present. This does not remove unavailable services from the compiled jar. Change-Id: I13571805083aa4e65519a74acb52efd17b9fb3d7
* | Merge commit '817ec49e' into manualmergeAmith Yamasani2013-12-201-250/+271
|\ \ | |/ | | | | | | | | | | Conflicts: services/print/java/com/android/server/print/PrintManagerService.java Change-Id: I1b9bf364ca50ee3c48f53d87ae0ce23e7f3c2bc2
| * Wrap some services into a SystemServiceAmith Yamasani2013-12-201-250/+271
| | | | | | | | | | | | | | | | These services can now be excluded by modifying the list of REQUIRED_SERVICES (TB renamed) Changed appwidget, devicepolicy, backup and print services. Change-Id: Id8e2855d5c045cd57bdb02dca9ed75172803bce7
* | am 9158825f: Move some system services to separate directoriesAmith Yamasani2013-12-191-3/+0
|/ | | | | * commit '9158825f9c41869689d6b1786d7c7aa8bdd524ce': Move some system services to separate directories
* Move some system services to separate directoriesAmith Yamasani2013-12-193-0/+2500
Refactored the directory structure so that services can be optionally excluded. This is step 1. Will be followed by another change that makes it possible to remove services from the build. Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85