35 Commits

Author SHA1 Message Date
Winson Chung
596b1850f3 Skip merge and assign RemoteViews directly if updateAppWidget() has not been called. (Bug 7214731)
Change-Id: Ie19b629deea9133800df265a2cebedc8bcb2a74d
2012-10-11 12:46:54 -07:00
Amith Yamasani
8320de8e29 Fix widget cross-talk between users due to Settings widget
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-10-05 17:24:37 -07:00
Adam Cohen
3ff2d867d4 Fixing AppWidgetService / AppWidgetHost to work in system process
-> Fixes issue 7208464
-> Fixed issue with partial update as well, should address
   issue 7214731

Change-Id: Ib8d9d5bee68b4fa7d6b4fbbc2f6609c287689958
2012-09-26 18:00:12 -07:00
Amith Yamasani
98edc95171 Load resources for the correct user
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-25 15:45:27 -07:00
Michael Jurka
9b93f4def1 Merge "Fix security check for private allocateAppWidgetId api" into jb-mr1-dev 2012-09-24 11:24:26 -07:00
Adam Cohen
db38d8a4ff Fixing typos
Change-Id: I3d470a18bd14a4040dffb0b0d8a11e282546057e
2012-09-21 18:14:58 -07:00
Michael Jurka
03bdc8a8f7 Fix security check for private allocateAppWidgetId api
Bug: 7182054
2012-09-21 16:10:21 -07:00
Adam Cohen
fbe44b7d5e Fixing partiallyUpdateAppWidget to cache the new changes
-> 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-20 15:18:47 -07:00
Jim Miller
f229e4d3eb Add support for settings for lock widgets
Change-Id: Iade094c6f32a7653bdbbd4921d345d68f2443ff4
2012-09-14 12:31:24 -07:00
Michael Jurka
ca5e341574 Fix bug with getting widget categories
Change-Id: I3b0f410707d37436732c45b572c2f588427a784f
2012-09-14 12:18:51 -07:00
Adam Cohen
0aa2d42e87 Adding notion of keyguard widgets
-> 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-09-11 10:53:57 -07:00
Amith Yamasani
61f57379ca Centralize the creation of the user system directory
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-31 15:33:21 -07:00
Amith Yamasani
f203aeef99 Enforce permissions for calls with specified userId
Fix a couple of places where incorrect userIds were being passed in.

Change-Id: I398c676e0488ff7e584be96e96c8b32652134238
2012-08-30 16:08:23 -07:00
Dianne Hackborn
79af1dd54c Switch public APIs to use new UserHandle class for identifying users.
Gets rid of "yet another integer" confusion.

Change-Id: Id07ea7307aea7c62f0087c6663a1f1c08e2e5dee
2012-08-17 10:36:08 -07:00
Dianne Hackborn
f02b60aa4f Rename UserId to UserHandle.
This is the start of turning this into a formal public API.

Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
2012-08-16 12:46:38 -07:00
Dianne Hackborn
b4163a6e12 Add APIs for interacting across users.
- 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-08-02 19:07:57 -07:00
Dianne Hackborn
39606a007a Make AtomicFile a public API. It's about time!
Change-Id: Ib34e294747405b7ab709cb0bbb2d9a0cc80ce86a
2012-07-31 17:54:52 -07:00
Jeff Brown
a8b9defade Stop using raw display size except in window manager.
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-25 11:38:48 -07:00
Adam Cohen
f08a8b78b6 Fixing issue where you couldn't set null RemoteViews for a widget
-> As noted here: http://code.google.com/p/android/issues/detail?id=35014

Change-Id: Id5d1c47b6961d4b448453d8b16700801c0137f2b
2012-07-16 12:04:17 -07:00
Winson Chung
4461f6028d Merge "Fixing index-out-of-bounds in AppWidgetService. (Bug 6717459)" 2012-07-09 16:43:04 -07:00
Winson Chung
a3195057fc Fixing index-out-of-bounds in AppWidgetService. (Bug 6717459)
Change-Id: I9d676fbb2110f01eb1d36adc59437a6a5ec97cc2
2012-06-25 10:02:50 -07:00
Michael Jurka
e1a1e40358 am 037faad0: am ab779e0b: Merge "Increase bitmap memory cap for widgets (Bug 6597440)" into jb-dev
* commit '037faad0f437c5fdc5435c030ef03d61de75090f':
  Increase bitmap memory cap for widgets (Bug 6597440)
2012-06-22 14:42:07 -07:00
Winson Chung
e92aad432a Increase bitmap memory cap for widgets (Bug 6597440)
Change-Id: I4149b8c5f204f10ebf0ef1f8d03709c0559178d0
2012-06-22 14:12:39 -07:00
Winson Chung
7fbd28438c Updating AppWidgetHost to receive a callback when any appWidget has changed. (Bug 6602951)
Change-Id: I76d688b10ee7775b4ebe81259713f2aaf0009d05
2012-06-13 15:29:19 -07:00
Adam Cohen
311c79c3e9 Cap widget bitmap usage by screen size (issue 6464700)
Change-Id: I04e16223861a88d40ad757afa086a0f92e84493b
2012-05-10 15:52:28 -07:00
Adam Cohen
dfed49a285 Merge "Changing app widget "extras" to "options" and another small API Review issue" into jb-dev 2012-05-02 10:38:01 -07:00
Adam Cohen
d2097ebacf Changing app widget "extras" to "options" and another small API Review issue
-> (issue 6427146), (issue 6427861)

Change-Id: Ib69a9b3717a5b62317ec227936bc3b2fd5954043
2012-05-02 09:32:42 -07:00
Amith Yamasani
e0eb39b548 Fix a bug in appwidget migration to multiuser directory.
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-05-01 13:48:48 -07:00
Michael Jurka
61a5b0160d New API to allow third-party apps to bind widgets
Change-Id: I1a3761c1a0f557a32d4d3bdd0207567fec918ba7
2012-04-24 17:25:08 -07:00
Adam Cohen
e8724c82ab Adding callback for widget size changed, and potentially other extra info
Change-Id: I57738c92b6a0ba68ae66b19a533559470c64e6f1
2012-04-19 18:01:46 -07:00
Amith Yamasani
135936072b User management and switching
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-27 11:23:01 -07:00
Amith Yamasani
483f3b06ea Package restrictions per user
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-03-22 10:08:24 -07:00
Amith Yamasani
67cf7d314b Fix Power Control widget
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
2012-02-16 15:03:42 -08:00
Amith Yamasani
37ce3a8af6 Multi-user - wallpaper service
- Allow each user to have their own wallpaper (live or static).
- Migrate old wallpaper on upgrade.
- Update SystemBackupAgent to backup/restore from primary user's
  new wallpaper directory.

Reduce dependency on Binder.getOrigCallingUser() by passing the
userId for bindService.

Change-Id: I19c8c3296d3d2efa7f28f951d4b84407489e2166
2012-02-10 14:34:07 -08:00
Amith Yamasani
742a671273 Multi-user - 1st major checkin
Switching activity stacks
Cache ContentProvider per user
Long-press power to switch users (on phone)

Added ServiceMap for separating services by user
Launch PendingIntents on the correct user's uid
Fix task switching from Recents list
AppWidgetService is mostly working.

Commands added to pm and am to allow creating and switching profiles.

Change-Id: I15810e8cfbe50a04bd3323a7ef5a8ff4230870ed
2012-02-03 12:01:47 -08:00