366 Commits

Author SHA1 Message Date
Svetoslav
b3038ec7cf Adding idle maintenance service.
It is beneficial that there is a mechanism on the platform
to notify applications whether it is safe to perform somehow
expensive operations while the user is not using the device.
Thus, user experience will not be degraded. An example is
discarding of unused blocks on a mounted file system instead
of doing this on every write operation.

bug:8056794

Change-Id: I708bad9d3ce6c8f1d5a1c05c0abf46f81a3d464b
2013-02-15 11:04:11 -08:00
Daniel Sandler
fde19b106b New API to request a list of current notifications.
The ACCESS_NOTIFICATIONS permission is signature|system only.

Change-Id: I41338230aee9611117cbdac251c1b6b6c3cebf00
2013-02-07 15:43:02 -05:00
Santos Cordon
3b53da4934 Merge "Sort out permission around "instant text response"" 2013-02-04 17:58:13 +00:00
Geremy Condra
d4b1d9cf9c Merge changes I4859c8db,I7643024d
* changes:
  Add the TZInfo updater and relevant intent.
  Fix ConfigUpdater for binary files.
2013-01-31 19:24:42 +00:00
Svetoslav
ec695824af Merge "Remove "enhance web scripts" from settings and make it requested by plug-ins." 2013-01-31 03:16:59 +00:00
Geremy Condra
78a4c718e3 Add the TZInfo updater and relevant intent.
Also add a hook for ConfigUpdateInstallReciever subclasses to
change the delivery of data- in this case, from raw text to
b64 encoded binary.

Change-Id: I4859c8db1cc97c2427310a108b2fef03975df2b4
2013-01-30 17:11:44 -08:00
Doug Zongker
58395e71ce am 9c4ba4fe: am b616f0c2: add android.permission.LOOP_RADIO for access to loop radio device
# Via Android Git Automerger (1) and Doug Zongker (1)
* commit '9c4ba4fe752b131b01aa402389c96eb8f24764b8':
  add android.permission.LOOP_RADIO for access to loop radio device
2013-01-29 17:09:03 -08:00
Svetoslav
3822896e22 Remove "enhance web scripts" from settings and make it requested by plug-ins.
Currently we have an "enhance web accessibility" setting that has to be
enabled to make sure web content is accessible. We added the setting to
get user consent because we are injecting JavaScript-based screen-reader
pulled from the Google infrastructure. However, many users do not know
that and (as expected) do not read the user documentation, resulting in
critique for lacking accessibility support in WebViews with JavaScript
enabled (Browser, Gmail, etc).

To smoothen the user experience now "enhance web accessibility" is a
feature an accessibility plug-in can request, similarly to explore by
touch. Now a user does not need to know that she has to explicitly
enable the setting and web accessibility will work out-of-the-box.

Before we were showing a dialog when a plug-in tries to put the device
in a touch exploration mode. However, now that we have one more feature
a plug-in can request, showing two dialogs (assume a plug-in wants both
features) will mean that a user should potentially deal with three
dialogs, one for enabling the service, and one for each feature. We
could merge the dialogs but still the user has to poke two dialogs.

It seems that the permission mechanism is a perfect fit for getting
user permission for an app to do something, in this case to enable
an accessibility feature. We need a separate permission for explore
by touch and enhance web accessibility since the former changes the
interaction model and the latter injects JavaScript in web pages. It
is critical to get user consent for the script injection part so we
need a well-documented permission rather a vague umbrella permission
for poking accessibility features. To allow better grouping of the
accessibility permissions this patch adds a permission group as well.

bug:8089372

Change-Id: Ic125514c34f191aea0416a469e4b3481ab3200b9
2013-01-29 13:56:22 -08:00
Doug Zongker
b616f0c239 add android.permission.LOOP_RADIO for access to loop radio device
Change-Id: I811d70fa67aa758122678809f32b8aade42ced0f
2013-01-29 10:39:13 -08:00
Dianne Hackborn
f9c5e0fe83 Add new API to propagate contextual data to the assist action
When launching an assist, we have a new API allowing the
current foreground activity/application to provide additional
arbitrary contextual information that is stuffed in the
assist intent before it is launched.

Change-Id: I0b2a6f5a266dc42cc0175327fa76774f814af3b4
2013-01-23 14:39:13 -08:00
Dianne Hackborn
35654b61e8 More work on App Ops service.
Implemented reading and writing state to retain information
across boots, API to retrieve state from it, improved location
manager interaction to monitor both coarse and fine access
and only note operations when location data is being delivered
back to app (not when it is just registering to get the data at
some time in the future).

Also implement tracking of read/write ops on contacts and the
call log.  This involved tweaking the content provider protocol
to pass over the name of the calling package, and some
infrastructure in the ContentProvider transport to note incoming
calls with the app ops service.  The contacts provider and call
log provider turn this on for themselves.

This also implements some of the mechanics of being able to ignore
incoming provider calls...  all that is left are some new APIs for
the real content provider implementation to be involved with
providing the correct behavior for query() (return an empty
cursor with the right columns) and insert() (need to figure out
what URI to return).

Change-Id: I36ebbcd63dee58264a480f3d3786891ca7cbdb4c
2013-01-16 12:11:01 -08:00
Dianne Hackborn
a06de0f29b New "app ops" service.
Initial implementation, tracking use of the vibrator, GPS,
and location reports.

Also includes an update to battery stats to also keep track of
vibrator usage (since I had to be in the vibrator code anyway
to instrument it).

The service itself is only half-done.  Currently no API to
retrieve the data (which once there will allow us to show you
which apps are currently causing the GPS to run and who has
recently accessed your location), it doesn't persist its data
like it should, and no way to tell it to reject app requests
for various operations.

But hey, it's a start!

Change-Id: I05b8d76cc4a4f7f37bc758c1701f51f9e0550e15
2013-01-09 12:47:47 -08:00
Daisuke Miyakawa
149ceec6eb Sort out permission around "instant text response"
- Remove SEND_SMS_NO_CONFIRMATION

- Add SEND_RESPOND_VIA_MESSAGE Permission
  This permission is held by the phone and applications that want to
  handle respond-via-message should require this permission of the
  sender.  This permission is signature/system and currently only held
  by the Phone app.

Bug: 5108429
Change-Id: Ib611368d488de2f8e1e853f550eb2c654305eda4
2012-12-06 16:24:48 -08:00
Nick Kralevich
a4405ba6ea Add new protected broadcasts
According to the javadocs for these intents, they are all
protected intents.  It appears the original author forgot
to add them to this file.

Change-Id: I025061716d5707f10939019f2bc5bc3d4d23b04f
2012-12-06 15:22:11 -08:00
Nick Kralevich
a170bb81d5 Remove duplicate AndroidManifest.xml entries.
The automerger added the entries twice...

Change-Id: I7910cb2126b339b0c8aee11051db1a2de8ae26ae
2012-12-05 16:11:42 -08:00
Nick Kralevich
849f5188e3 am 6643ea82: resolved conflicts for merge of 011132a7 to jb-mr1-dev
* commit '6643ea823bf8b0726da0518ffecfcc7a9f60f87d':
  Secure a handful of framework broadcasts
2012-11-30 10:35:44 -08:00
Nick Kralevich
6643ea823b resolved conflicts for merge of 011132a7 to jb-mr1-dev
Change-Id: I304ef91eef99526dec348a59b12c0934173bcfcb
2012-11-30 10:23:56 -08:00
Robert Greenwalt
b8da0376f2 Secure a handful of framework broadcasts
At least one of these was getting spoofed in the wild.
We don't want to go too far this late in the game, but this is a good start.

bug:7622253
(cherry picked from commit 47918ae3b4e7ebb54711884e9ff9d0300591ab8b)

Conflicts:

	core/res/AndroidManifest.xml

Change-Id: I118b31489fe7add5b8d69289cab9f4e8ab269495
2012-11-29 13:06:23 -08:00
Robert Greenwalt
47918ae3b4 Secure a handful of framework broadcasts
At least one of these was getting spoofed in the wild.
We don't want to go too far this late in the game, but this is a good start.

bug:7622253
Change-Id: Id8ec2778b15fe001e6fd0d5a010181bb21c52ad8
2012-11-28 16:42:32 -08:00
Scott Main
2681faafae docs: explain implicit permissions applied by sdk versions
bug: 7453055

Change-Id: I59ba2de6108b5209ff0db6b084fc0a887c5f2cce
2012-11-01 15:59:22 -07:00
Geremy Condra
7dcacd559a Change android.permission.SERIAL_PORT to signature|system.
Bug: 7367956
Change-Id: I0bc65936ba59c43c18d9a6ba52affff4c921f2fb
2012-11-01 14:10:21 -07:00
Scott Main
277b352d9f docs: update description for location permissions
bug: 6996667

Change-Id: I3b5d706d98b56386a88b33a343721ff7432063b9
2012-11-01 10:55:02 -07:00
Michael Jurka
fc753c0cf6 Use new keyguard appwidget picker
Also, remove ability to filter widgets by feature
in appwidget picker in anticipation of api change

Change-Id: I325de0b98f03d3a250758d504229ea27794b5330
2012-10-31 16:53:04 -07:00
Geremy Condra
a1f739ea83 Merge "Change android.permission.SERIAL_PORT to signature|system." into jb-mr1-dev 2012-10-18 23:59:37 -07:00
Geremy Condra
c29f35b8f4 Change android.permission.SERIAL_PORT to signature|system.
Bug: 7367956
Change-Id: I0bc65936ba59c43c18d9a6ba52affff4c921f2fb
2012-10-17 14:06:31 -07:00
Matthew Xie
fca9d63635 Add multi user support for bluetooth
Create a BLUETOOTH_STACK permission to share between all users of
Bluetooth apk. Bluetooth Manager binds to apk of current user
bug 6925422

Change-Id: I2df5546e977c2d77bc66d97d12479d933826922a
2012-10-04 18:35:42 -07:00
Jatin Lodhia
7c3586c576 Merge "Make the theme for choose account and choose account type dialogs same." into jb-mr1-dev 2012-09-28 18:50:20 -07:00
Dianne Hackborn
3ff8e1a800 Merge "Fix issue #7211769 and #7244492, thrash around on #7226656." into jb-mr1-dev 2012-09-28 15:54:44 -07:00
Dianne Hackborn
d4ac8d7b3d Fix issue #7211769 and #7244492, thrash around on #7226656.
Issue #7211769: Crash dialog from background user has non-working "report"

The report button now launches the issue reporter for the correct user.
Also for crashes on background users, either disable the report button,
or simply don't show the dialog depending on the build config.

Issue #7244492: Bugreport button in Quick Settings doesn't actually do anything

Now they do.

Issue #7226656: second user seeing primary user's apps

I haven't had any success at reproducing this.  I have tried to tighten up
the path where we create the user to ensure nothing could cause the
user's applications to be accessed before the user it fully created and thus
make them installed...  but I can't convince myself that is the actual problem.

Also tightened up the user switch code to use forground broadcasts for all
of the updates about the switch (since this is really a foreground operation),
added a facility to have BOOT_COMPELTED broadcasts not get launched for
secondary users and use that on a few key system receivers, fixed some debug
output.

Change-Id: Iadf8f8e4878a86def2e495e9d0dc40c4fb347021
2012-09-28 15:37:22 -07:00
Jatin Lodhia
856b01e7e4 Make the theme for choose account and choose account type dialogs same.
Contacts app uses a custom account picker which calls the system account picker
when an account needs to be added. The system accout picker invokes choose
accout type dialog which overlays over the system acccount picker. Because these
two dialog boxes use different themes, he one behind is wider than the one in
foreground and ends up looking like a thin black strip protruding from the two
sides.
Bug: 6980517

Change-Id: Ia8b23767d995dcbe1a58087cb4bfbee140c2c744
2012-09-28 10:53:37 -07:00
Robert Greenwalt
c6fa237dae Use updatable file for premium-sms filter
The data is really to big for a gservices-driven secure setting.

bug:7221402
Change-Id: Ie3d4a1a0aeb69b9ef8fad360fa7ec32e927644e8
2012-09-28 10:24:09 -07:00
Svetoslav Ganov
7befb7deb2 Global gesture to toggle Accessibility system-wide.
1. This change adds a global gesture for enabling accessibility.
   To enable this gesture the user has to allow it from the
   accessibility settings or use the setup wizard to enable
   accessibility. When the global gesture is enabled the user
   can long press on power to bring the global actions dialog
   and then hold with two fingers for a few seconds to enable
   accessibility. The appropriate feedback is also provided.

2. The global gesture is writing directly into the settings for
   the current user if performed when the keyguard is not on. If
   the keygaurd is on and the current user has no accessibility
   enabled, the gesture will temporary enable accessibility
   for the current user, i.e. no settings are changed, to allow
   the blind user to log into his account. As soon as a user
   switch happens the new user settings are inherited. If no
   user change happens after temporary enabling accessibility
   the temporary changes will be undone when the keyguard goes
   away and the device will works as expected by the current user.

bug:6171929

3. The initialization code for the owner was not executed due
   to a redundant check, thus putting the accessibility layer in
   an inconsistent state which breaks pretty much everything.

bug:7240414

Change-Id: Ie7d7aba80f5867b7f88d5893b848b53fb02a7537
2012-09-27 20:33:20 -07:00
Dianne Hackborn
52c62344c5 Fix issue #7213113: Remove old intent resolver
Also make the query package restart broadcast protected like the
documentation says it should be.

Change-Id: I445166111318a02f2f2b1ab0dff9c641a441c20b
2012-09-21 17:04:16 -07:00
John Spurlock
f4f6b4c8b0 Fire "dreaming started" and "dreaming stopped" broadcasts.
Dream manager now fires broadcast intents when entering + exiting
dreamland (except when testing).

Power manager can now listen for dreams ending, using polling only
as a backstop.

Also:
 - Bullet-proof dream-manager/dream against known failure modes
 - Add new read/write dream permissions
 - Refactor dream-manager to delegate work + state management into
   a new DreamController class, via a handler

Bug:6999949
Bug:7152024
Change-Id: I986bb7812209d8c95ae1d660a5eee5998a7b08b1
2012-09-19 17:36:50 -04:00
Dianne Hackborn
8832c18d8b Fix API review bugs.
7173152 API REVIEW: android.content.pm.PackageUserState
7172969 API REVIEW: android.app.PendingIntent
7172730 API REVIEW: android.content.Context
7172726 API REVIEW: android.manifest.permission

Change-Id: Iad470256d3b5ca5596487f6a699ec1871457c3b5
2012-09-17 17:27:15 -07:00
Dianne Hackborn
2ca2c87871 More adjustments to permissions.
- New "cost money" flag can be put on a permission to
  have this emphasized in the UI.
- Some further re-organization of permissions to better
  match UX spec.

Change-Id: I450ac739eff6b90e7c7fc39589d68db82b61f897
2012-09-16 16:41:27 -07:00
Dianne Hackborn
5dc5a00e7e More multi-user stuff.
- New public APIs to find out when a user goes to the foreground,
  background, and is first initializing.
- New activity manager callback to be involved in the user switch
  process, allowing other services to let it know when it is safe
  to stop freezing the screen.
- Wallpaper service now implements this to handle its user switch,
  telling the activity manager when it is done.  (Currently this is
  only handling the old wallpaper going away, we need a little more
  work to correctly wait for the new wallpaper to get added.)
- Lock screen now implements the callback to do its user switch.  It
  also now locks itself when this happens, instead of relying on
  some other entity making sure it is locked.
- Pre-boot broadcasts now go to all users.
- WallpaperManager now has an API to find out if a named wallpaper is
  in use by any users.

Change-Id: I27877aef1d82126c0a1428c3d1861619ee5f8653
2012-09-15 23:58:55 -07:00
Geremy Condra
f60921d921 Merge changes I69689a73,Iaaef6d41,I7e3cb47a,I42307f58 into jb-mr1-dev
* changes:
  DO NOT MERGE Push event logging down into libcore.EventLogger
  DO NOT MERGE Added event logging for config installation failures.
  DO NOT MERGE Create intermediate directories when installing config data.
  DO NOT MERGE Add components for the Android Config Updater to system server.
2012-09-13 10:42:22 -07:00
Dianne Hackborn
cd403fc031 Bring back new permission organization.
Change-Id: I83e7dd06989ab7b0116bcff5ad52d36e01b851d1
2012-09-13 00:24:38 -07:00
Geremy Condra
b631084613 DO NOT MERGE Add components for the Android Config Updater to system server.
This adds the necessary bits to verify and install configuration
updates using system server. It also includes the cert pinning
updater as the first user.

Change-Id: I42307f58074157b33b6e01216aab10022340d449
2012-09-12 17:53:53 -07:00
Fabrice Di Meglio
5cf8bd79bb Merge "Fix bug #7141044 GlobalActions dialog (power off / airplane mode / sound off) should be RTL aware" into jb-mr1-dev 2012-09-11 11:18:15 -07:00
Fabrice Di Meglio
4497e0c3c6 Fix bug #7141044 GlobalActions dialog (power off / airplane mode / sound off) should be RTL aware
- add android:supportsRtl="true" to the manifest for system_process

Change-Id: I9794f6880c883d91751d0037646253810b086d46
2012-09-10 20:46:33 -07:00
Dianne Hackborn
9d9ece3c1e Animations for user switching.
The window manager now has a facility to provide a full-screen
animation, which the activity manager uses every time a user
switch happens.

The current animation is just a simple dumb slide until we get
a design from UX.

Also some cleanup: moved the portrait task animations to the
default config so we always have an animation for them, and finally
got the java symbol stuff out of public.xml.

Change-Id: I726f77422b2ef5f2d98f961f8da003e045f0ebe8
2012-09-10 19:58:21 -07:00
Jeff Brown
e08ae388d6 Add new wifi display discovery API.
The API is quite simple.  There are a few extra functions
on DisplayManager to scan, connect and disconnect from
wifi displays and get status, and a single protected
broadcast sent when the status changes.

Change-Id: Ic91dbab5ee818e790b27fa32e1a1e93788793be0
2012-09-08 14:53:34 -07:00
Jeff Brown
4b71e4e66c Add permissions to control and configure wifi display.
Change-Id: I54af6da53b7243516becd6a3d5985c0feda6c225
2012-09-07 17:50:57 -07:00
Svetoslav Ganov
1cf70bbf96 Screen magnification - feature - framework.
This change is the initial check in of the screen magnification
feature. This feature enables magnification of the screen via
global gestures (assuming it has been enabled from settings)
to allow a low vision user to efficiently use an Android device.

Interaction model:

1. Triple tap toggles permanent screen magnification which is magnifying
   the area around the location of the triple tap. One can think of the
   location of the triple tap as the center of the magnified viewport.
   For example, a triple tap when not magnified would magnify the screen
   and leave it in a magnified state. A triple tapping when magnified would
   clear magnification and leave the screen in a not magnified state.

2. Triple tap and hold would magnify the screen if not magnified and enable
   viewport dragging mode until the finger goes up. One can think of this
   mode as a way to move the magnified viewport since the area around the
   moving finger will be magnified to fit the screen. For example, if the
   screen was not magnified and the user triple taps and holds the screen
   would magnify and the viewport will follow the user's finger. When the
   finger goes up the screen will clear zoom out. If the same user interaction
   is performed when the screen is magnified, the viewport movement will
   be the same but when the finger goes up the screen will stay magnified.
   In other words, the initial magnified state is sticky.

3. Pinching with any number of additional fingers when viewport dragging
   is enabled, i.e. the user triple tapped and holds, would adjust the
   magnification scale which will become the current default magnification
   scale. The next time the user magnifies the same magnification scale
   would be used.

4. When in a permanent magnified state the user can use two or more fingers
   to pan the viewport. Note that in this mode the content is panned as
   opposed to the viewport dragging mode in which the viewport is moved.

5. When in a permanent magnified state the user can use three or more
   fingers to change the magnification scale which will become the current
   default magnification scale. The next time the user magnifies the same
   magnification scale would be used.

6. The magnification scale will be persisted in settings and in the cloud.

Note: Since two fingers are used to pan the content in a permanently magnified
   state no other two finger gestures in touch exploration or applications
   will work unless the uses zooms out to normal state where all gestures
   works as expected. This is an intentional tradeoff to allow efficient
   panning since in a permanently magnified state this would be the dominant
   action to be performed.

Design:

1. The window manager exposes APIs for setting accessibility transformation
   which is a scale and offsets for X and Y axis. The window manager queries
   the window policy for which windows will not be magnified. For example,
   the IME windows and the navigation bar are not magnified including windows
   that are attached to them.

2. The accessibility features such a screen magnification and touch
   exploration are now impemented as a sequence of transformations on the
   event stream. The accessibility manager service may request each
   of these features or both. The behavior of the features is not changed
   based on the fact that another one is enabled.

3. The screen magnifier keeps a viewport of the content that is magnified
   which is surrounded by a glow in a magnified state. Interactions outside
   of the viewport are delegated directly to the application without
   interpretation. For example, a triple tap on the letter 'a' of the IME
   would type three letters instead of toggling magnified state. The viewport
   is updated on screen rotation and on window transitions. For example,
   when the IME pops up the viewport shrinks.

4. The glow around the viewport is implemented as a special type of window
   that does not take input focus, cannot be touched, is laid out in the
   screen coordiates with width and height matching these of the screen.
   When the magnified region changes the root view of the window draws the
   hightlight but the size of the window does not change - unless a rotation
   happens. All changes in the viewport size or showing or hiding it are
   animated.

5. The viewport is encapsulated in a class that knows how to show,
   hide, and resize the viewport - potentially animating that.
   This class uses the new animation framework for animations.

6. The magnification is handled by a magnification controller that
   keeps track of the current trnasformation to be applied to the screen
   content and the desired such. If these two are not the same it is
   responsibility of the magnification controller to reconcile them by
   potentially animating the transition from one to the other.

7. A dipslay content observer wathces for winodw transitions, screen
   rotations, and when a rectange on the screen has been reqeusted. This
   class is responsible for handling interesting state changes such
   as changing the viewport bounds on IME pop up or screen rotation,
   panning the content to make a requested rectangle visible on the
   screen, etc.

8. To implement viewport updates the window manger was updated with APIs
   to watch for window transitions and when a rectangle has been requested
   on the screen. These APIs are protected by a signature level permission.
   Also a parcelable and poolable window info class has been added with
   APIs for getting the window info given the window token. This enables
   getting some useful information about a window. There APIs are also
   signature protected.

bug:6795382

Change-Id: Iec93da8bf6376beebbd4f5167ab7723dc7d9bd00
2012-09-06 18:56:17 -07:00
rich cannings
d1b5cfc94a Notify verifiers that verification is complete
Send the Intent.ACTION_PACKAGE_VERIFIED to all verifiers when
verification is complete (either one verifier verified the package or a
timeout occurred). Details of what occurred is in a new extra,
PackageManager.EXTRA_VERIFICATION_RESULT.

Bug: 7048930
Change-Id: I4f9855a29b0eb6d77f469891402c69e2e8922945
2012-08-30 16:00:59 -07:00
Jeff Sharkey
e217ee4d7a Access to all users' external storage.
System services holding this permission have external storage bound
one level higher, giving them access to all users' files.

Bug: 7003520
Change-Id: Ib2bcb8455740c713ebd01f71c9a2b89b4e642832
2012-08-30 10:37:51 -07:00
Dianne Hackborn
80a4af2bbc Start implementing concept of "running" users.
The activity manager now keeps track of which users are running.

Initially, only user 0 is running.

When you switch to another user, that user is started so it is
running.  It is only at this point that BOOT_COMPLETED is sent
for that user and it is allowed to execute anything.

You can stop any user except user 0, which brings it back to the
same state as when you first boot the device.  This is also used
to be able to more cleaning delete a user, by first stopping it
before removing its data.

There is a new broadcast ACTION_USER_STOPPED sent when a user is
stopped; system services need to handle this like they currently
handle ACTION_PACKAGE_RESTARTED when individual packages are
restarted.

Change-Id: I89adbd7cbaf4a0bb72ea201385f93477f40a4119
2012-08-28 16:30:55 -07:00
rich cannings
7e67151b91 Add permission checks for Verification API calls
Ensure that only applications with
android.Manifest.permission.PACKAGE_VERIFICATION_AGENT can call application
verification APIs, like PackageManager.verifyPendingInstall and
PackageManager.extendVerificationTimeout

Bug: 7049083
Change-Id: I5fc28b37e864d67cd319a1ed9d03a90dd15ad052
2012-08-28 14:00:46 -07:00