summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/AppWidgetServiceImpl.java
AgeCommit message (Collapse)Author
2013-11-12Move some system services to their own sub package.Amith Yamasani
As a next step they can be moved into separate directories to be built as separate modules that may or may not be included in a particular configuration. Moves AppWidgetService, BackupManagerService, ClipboardService, DevicePolicyMS, and WallpaperMS. Change-Id: I33e48d070f38186819d3a1d7a4dc3984b75a9eda
2013-03-23am 8277f248: am b685faa2: Merge "Implement #8323587, #8323342, #8323590: new ↵Dianne Hackborn
features." into jb-mr2-dev * commit '8277f24865e52915b4825517860629c0385f79ed': Implement #8323587, #8323342, #8323590: new features.
2013-03-22Implement #8323587, #8323342, #8323590: new features.Dianne Hackborn
8323587: Add feature for supporting app widgets 8323342: Add feature for replacing the home screen 8323590: Add feature for supporting input methods The app widget service looks for the app widget feature and refuses to work if it doesn't exist. I didn't do this for the input method service because some devices will probably want to still make use of that mechanism without supporting third party input methods. Change-Id: Ie3b089105e104f4d767cdb03cdbe4fdb1c17382e
2013-03-08Add "database" upgrader for widget hosts.Jim Miller
When keyguard moved to a new process, the package name changed which caused the old widgets to be lost. This change migrates the old widget host for keyguard and adds a mechanism to perform future upgrades. Updated after review. Change-Id: I78a616501ddc71e3b1e86622d353eb82528f9eff
2013-02-20Add explicit userId to AppWidget binder callsJim Miller
Keyguard currently relies on being in the system process to grab the given user's widgets. When we split keyguard into a new process, it will need to have access to user-specific info to instantiate a specific user's widgets. In order to accomplish this, we add an explicit userid to each binder call as well as new permission check to allow keyguard access. This also fixes a potential race condition of having an incorrect user id due to an async call to change the user. Every binder call now has a specific user id. The user id is either the calling process user's id or an explicit one passed by applications like keyguard. It is created once when an AppWidgetManager is instantiated and remains for the lifetime of the object. Fixed bug where widgets sometimes didn't show up for secondary users. Moved permission check in AppWidgetService into getImplForUser() Refactored to use userid from context associated AppWidgetManager instance. Clean up AppWidgetHost to use userId from Context. Remove redundant userId check in checkPermission since it's handled by ActivityManager.handleIncomingUser() Removed redundant userid check. Upload after rebase... Change-Id: Iae3e20f2b342c323bb58768b3d22051510f8268b
2013-01-16Rename bindService to bindServiceAsUser to follow convention.Amith Yamasani
This is for the multi-user version of bindService, not the original. Change-Id: Ib2de35941196accf387b1a276a77e6f9af805ec0
2012-11-30Fix crosstalk between users for widgets hosted in lockscreenAmith Yamasani
This was initially about the Clock widget crashing repeatedly on some devices with multiple users. Turned out that there were race conditions when switching users that could result in remote views of one user calling back to the RemoteViewsAdapter in keyguard that in turn sent an incorrect widget id to a different user's widget, resulting in a crash. Since KeyguardHostView is instantiated in the same process for different users, it needs to carry a user identity to pass along to AppWidgetService so that remote views services were bound to the correct user and callbacks were attached and detached properly. Added some aidl calls that take the userId to do the binding properly. A more complete fix might be needed in the future so that all calls from Keyguard carry the user id. Also, there was a problem in comparing host uid for secondary users, since Settings for a secondary user has a different uid than keyguard. Not an issue on single-user systems. Changed the host.uid comparison to accomodate for the secondary user. Bug: 7450247 Change-Id: Idbc36e3c60023cac74174f6cb7f2b2130dd3052c
2012-11-28Merge "Making sure keyguard and homescreen only display eligible widgets ↵Adam Cohen
(issue 7550090)" into jb-mr1.1-dev
2012-11-28Making sure keyguard and homescreen only display eligible widgets (issue ↵Adam Cohen
7550090) Change-Id: I25acb7bde2e8e5ac3185a009f5c7151b81f0ae19
2012-11-26Logging to help find the cause of widget crash in clock widget.Amith Yamasani
This will continue to crash as before, but will show some useful information in the exception. Bug: 7450247 Change-Id: Ib3160a5f64154517791d165973c12294ecd09901
2012-11-16Delete appWidgetId when removing lockscreen widgetsMichael Jurka
Bug: 7550012 Change-Id: Ia9f5266256016eb91bfd6a2d5a7f910c42948f1e
2012-11-15Making sure launcher doesn't show keyguard-only widgets (issue 7550090)Adam Cohen
Change-Id: I5d0675f0c03677e06371a6730209c3466c6b0f15
2012-11-15Pushing state persistence to a background threadAdam Cohen
Change-Id: If776bc22c48525ba91dc7e4dd0e27de92612f2f5
2012-11-01Use clock's widget as the default keyguard widgetMichael Jurka
Also, if we have no widgets in lockscreen, reinflate the default widget. If that fails, inflate the built-in clock (KeyguardStatusView) Change-Id: I2e90ab0893c993a755700e075e4a8ac5a685e0f2
2012-10-31Stripping dead API related to keyguard widgetsAdam Cohen
Change-Id: Ieb6c57ef736712b3266de08027f9626104cdf1bb
2012-10-15Do cleanup when Stopping usersAmith Yamasani
Mark user 0 as initialized, otherwise it will show up as uninitialized when viewed from secondary user if never switched to user 0. Bug: 7301595 Also clean up any users that were in the process of being removed, if device crashes at a bad time. Change-Id: Ic16a6c9ccb6a64b7463725f6cc279335a821fcd5
2012-10-11Letting partial update fall through if the widget has not received a full ↵Winson Chung
update yet. (Bug 7214731) Change-Id: I4da99c259df51f8f66d3ade1156040bd0360ca5d
2012-10-11Skip merge and assign RemoteViews directly if updateAppWidget() has not been ↵Winson Chung
called. (Bug 7214731) Change-Id: Ie19b629deea9133800df265a2cebedc8bcb2a74d
2012-10-05Fix widget cross-talk between users due to Settings widgetAmith Yamasani
Bug: 7247911 Bug: 7294899 Also did some cleanup of unused code that resulted from refactoring the app widget service. Fixed a few more ambiguous calls that weren't using the correct user id. Added some logging and improved the dump() formatting. Change-Id: I27abb5c6341458e1e50a2cc9ab67e8de573ab283
2012-09-26Fixing AppWidgetService / AppWidgetHost to work in system processAdam Cohen
-> Fixes issue 7208464 -> Fixed issue with partial update as well, should address issue 7214731 Change-Id: Ib8d9d5bee68b4fa7d6b4fbbc2f6609c287689958
2012-09-25Load resources for the correct userAmith Yamasani
For apps that are only installed on secondary users, the SystemUI is unable to see them by default. Added some methods to explicitly pass the userId of the user the resources are requested for by the StatusBarIcon Bug: 7214384 Also fix binding to remote views Bug: 7192802 Change-Id: I5d6c5f624aa37fb231f3467f9764c8d99077a91d
2012-09-24Merge "Fix security check for private allocateAppWidgetId api" into jb-mr1-devMichael Jurka
2012-09-21Fixing typosAdam Cohen
Change-Id: I3d470a18bd14a4040dffb0b0d8a11e282546057e
2012-09-21Fix security check for private allocateAppWidgetId apiMichael Jurka
Bug: 7182054
2012-09-20Fixing partiallyUpdateAppWidget to cache the new changesAdam Cohen
-> This is a good change to the widget framework that I've wanted to make for a while, but issue 7174198 triggered the immediate need. Change-Id: I3f267e0e67f2d9f28920bb53973af365a3c9e0ba
2012-09-14Add support for settings for lock widgetsJim Miller
Change-Id: Iade094c6f32a7653bdbbd4921d345d68f2443ff4
2012-09-14Fix bug with getting widget categoriesMichael Jurka
Change-Id: I3b0f410707d37436732c45b572c2f588427a784f
2012-09-11Adding notion of keyguard widgetsAdam Cohen
-> Persisting certain appwidget options -> Adding ability to specify appwidget options on bind so as to avoid AppWidgetProvider update call with no options. Change-Id: I5631039f19f1822b8e123b559b6353c880c0192e
2012-08-31Centralize the creation of the user system directoryAmith Yamasani
Environment.getUserSystemDirectory(int userId) Use it all relevant places that was hardcoding it. Also, wipe out the user's system directory when user is removed, otherwise old state might be transferred to a new user. Change-Id: I788ce9c4cf9624229e65efa7047bc0c019ccef0a
2012-08-30Enforce permissions for calls with specified userIdAmith Yamasani
Fix a couple of places where incorrect userIds were being passed in. Change-Id: I398c676e0488ff7e584be96e96c8b32652134238
2012-08-17Switch public APIs to use new UserHandle class for identifying users.Dianne Hackborn
Gets rid of "yet another integer" confusion. Change-Id: Id07ea7307aea7c62f0087c6663a1f1c08e2e5dee
2012-08-16Rename UserId to UserHandle.Dianne Hackborn
This is the start of turning this into a formal public API. Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
2012-08-02Add APIs for interacting across users.Dianne Hackborn
- Expose the existing Context.sendBroadcast() as Context.sendBroadcastAsUser(). - Add new android:singleUser attribute for services. - Add new INTERACT_ACROSS_USERS_FULL permission for full system-level access to cross-user interface (allows sendBroadcastAsUser() to send to any receiver). - Add new INTERACT_ACROSS_USERS_FULL permission for more restricted cross-user interaction: this is required for android:singleUser, and allows you to use sendBroadcastAsUser() but only to send to your own receivers. Change-Id: I0de88f6718e9505f4de72e3f45d29c0f503b76e9
2012-07-31Make AtomicFile a public API. It's about time!Dianne Hackborn
Change-Id: Ib34e294747405b7ab709cb0bbb2d9a0cc80ce86a
2012-07-25Stop using raw display size except in window manager.Jeff Brown
We don't actually need the raw size in these places. The logical size is good enough. Starting to move dependencies on surface flinger and window manager out of the Display class. Change-Id: I2065bee8e5bf7f42c5a452dd1e8479e40ebb0d37
2012-07-16Fixing issue where you couldn't set null RemoteViews for a widgetAdam Cohen
-> As noted here: http://code.google.com/p/android/issues/detail?id=35014 Change-Id: Id5d1c47b6961d4b448453d8b16700801c0137f2b
2012-07-09Merge "Fixing index-out-of-bounds in AppWidgetService. (Bug 6717459)"Winson Chung
2012-06-25Fixing index-out-of-bounds in AppWidgetService. (Bug 6717459)Winson Chung
Change-Id: I9d676fbb2110f01eb1d36adc59437a6a5ec97cc2
2012-06-22am 037faad0: am ab779e0b: Merge "Increase bitmap memory cap for widgets (Bug ↵Michael Jurka
6597440)" into jb-dev * commit '037faad0f437c5fdc5435c030ef03d61de75090f': Increase bitmap memory cap for widgets (Bug 6597440)
2012-06-22Increase bitmap memory cap for widgets (Bug 6597440)Winson Chung
Change-Id: I4149b8c5f204f10ebf0ef1f8d03709c0559178d0
2012-06-13Updating AppWidgetHost to receive a callback when any appWidget has changed. ↵Winson Chung
(Bug 6602951) Change-Id: I76d688b10ee7775b4ebe81259713f2aaf0009d05
2012-05-10Cap widget bitmap usage by screen size (issue 6464700)Adam Cohen
Change-Id: I04e16223861a88d40ad757afa086a0f92e84493b
2012-05-02Merge "Changing app widget "extras" to "options" and another small API ↵Adam Cohen
Review issue" into jb-dev
2012-05-02Changing app widget "extras" to "options" and another small API Review issueAdam Cohen
-> (issue 6427146), (issue 6427861) Change-Id: Ib69a9b3717a5b62317ec227936bc3b2fd5954043
2012-05-01Fix a bug in appwidget migration to multiuser directory.Amith Yamasani
Bug: 6393606 Migrate the old appwidgets.xml if the file doesn't exist, not if the directory doesn't exist. It worked earlier because this was the first service that I migrated to multi-user :( Change-Id: I59bcbc31ff9d101e44dff5e5f44b3cab8f08dc06
2012-04-24New API to allow third-party apps to bind widgetsMichael Jurka
Change-Id: I1a3761c1a0f557a32d4d3bdd0207567fec918ba7
2012-04-19Adding callback for widget size changed, and potentially other extra infoAdam Cohen
Change-Id: I57738c92b6a0ba68ae66b19a533559470c64e6f1
2012-03-27User management and switchingAmith Yamasani
Broadcast intents that get sent out when users are added/removed/switched. More work on generating user-specific information in package manager queries. APIs to update user name and query a user by id. Removed Package.mSetStopped and mSetEnabled, since they're not user specific. User removal: - Cleanup ActivityManager, PackageManager, WallpaperManager, AppWidgetService and AccountManager. - Shutdown processes belonging to the user. Don't show vibrate option in long-press power if there's no vibrator. Lock the screen when switching users, to force unlocking. Change-Id: Ib23a721cb75285eef5fd6ba8c7272462764038fa
2012-03-22Package restrictions per userAmith Yamasani
Packages can be enabled/disabled per user. This requires maintaining stopped/launched states and enabled / disabled components and packages per user. Refactored pm.Settings and PackageSettingsBase to keep track of states per user. Migrated the stopped-packages.xml to users/<u>/package-restrictions.xml Changed intent resolution to handle individual user restrictions. Bunch of IPackageManager calls now have a userId argument. Make AppWidgetService handle removals of packages. Added some tests for pm.Settings and PackageManager. Change-Id: Ia83b529e1df88dbcb3bd55ebfc952a6e9b20e861
2012-02-16Fix Power Control widgetAmith Yamasani
Some changes in AppWidgetService were interfering with widget permissions. Added some hidden methods in Context to communicate the requesting user information instead of using the calling uid. Bug: 6019296 Change-Id: I5e519fd3fbbfa5b3fcc5c297b729c671dac8e7c7