diff options
| author | Svetoslav <svetoslavganov@google.com> | 2014-08-06 22:05:48 -0700 |
|---|---|---|
| committer | Svetoslav Ganov <svetoslavganov@google.com> | 2014-08-07 05:14:36 +0000 |
| commit | 985e566ceca9c11d2f740499053f37dfaeb9033d (patch) | |
| tree | b6dc8b3ba3543e9c3df516bfe5b07bb08313e368 /core/java | |
| parent | 14b7c54eeae4285f3c5084787c0607dd3103f20c (diff) | |
| download | frameworks_base-985e566ceca9c11d2f740499053f37dfaeb9033d.zip frameworks_base-985e566ceca9c11d2f740499053f37dfaeb9033d.tar.gz frameworks_base-985e566ceca9c11d2f740499053f37dfaeb9033d.tar.bz2 | |
Fix cross-user talk.
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
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/widget/AdapterViewFlipper.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/java/android/widget/AdapterViewFlipper.java b/core/java/android/widget/AdapterViewFlipper.java index 3b026bd..285dee8 100644 --- a/core/java/android/widget/AdapterViewFlipper.java +++ b/core/java/android/widget/AdapterViewFlipper.java @@ -105,7 +105,17 @@ public class AdapterViewFlipper extends AdapterViewAnimator { final IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_SCREEN_OFF); filter.addAction(Intent.ACTION_USER_PRESENT); - getContext().registerReceiver(mReceiver, filter); + + // OK, this is gross but needed. This class is supported by the + // remote views machanism and as a part of that the remote views + // can be inflated by a context for another user without the app + // having interact users permission - just for loading resources. + // For exmaple, when adding widgets from a user profile to the + // home screen. Therefore, we register the receiver as the current + // user not the one the context is for. + getContext().registerReceiverAsUser(mReceiver, android.os.Process.myUserHandle(), + filter, null, mHandler); + if (mAutoStart) { // Automatically start when requested |
