10677 Commits

Author SHA1 Message Date
Jeff Sharkey
51366be80f Sync APIs use seconds instead of ms.
Bug: 7668972
Change-Id: I7b253fe17d9539695adc474a69546645586b5f1a
2013-03-27 14:46:55 -07:00
Amith Yamasani
df5e9fe181 Merge "Device Owner, a special kind of device admin" into jb-mr2-dev 2013-03-26 22:27:13 +00:00
Amith Yamasani
71e6c697e5 Device Owner, a special kind of device admin
A Device Owner cannot be uninstalled and is available to all users. It must
be registered before the device_provisioned flag is set.

Device admins can be disabled until used, but visible to device policy
manager, so that users wont be bothered with update requests.

Opened up a few related APIs for use by a system-installed Device Owner.

Change-Id: I847b5fe68c0f724863f778a67602b5bddc79d8e5
2013-03-26 15:09:08 -07:00
Jeff Sharkey
7e9221c554 Merge "It helps to catch the right exception." into jb-mr2-dev 2013-03-26 17:29:43 +00:00
Jeff Sharkey
9ae62f5934 It helps to catch the right exception.
Bug: 7238149
Change-Id: I7b60ec44d1d1d5ece8a871cb089f811b611f4a4a
2013-03-26 10:29:01 -07:00
Geremy Condra
df4144f4df am 9fa57b74: am 2aee33c1: Merge "BackupManagerService files need new security labeling."
* commit '9fa57b74d8acb99c86f761a98f6e76998de8aff2':
  BackupManagerService files need new security labeling.
2013-03-25 22:29:10 -07:00
Geremy Condra
2aee33c1cd Merge "BackupManagerService files need new security labeling." 2013-03-26 05:10:38 +00:00
Robert Craig
0f40dc923c Add seinfo parsing to PackageManagerService.
This patch set allows the PMS to parse the
mac_permissions.xml file which contains the
seinfo values. Each package that is installed
on the device will be assigned an seinfo value
based on policy. This seinfo value will help label
the app process and data directory.  Modifications
include adjustments to ApplicationInfo.java
to store the seinfo tag per package as well as
adjustments to installd to communicate the seinfo
tag to libselinux.

Change-Id: I61ad1ea12fb6a9a6d0b108ec163bc4bf4c954b58
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
2013-03-25 17:30:08 -07:00
Nick Kralevich
c498614414 PackageManagerService: update grantPermission / revokePermission
Currently, grantPermission / revokePermission only handles development
permissions. This change extends these two functions to handle normal
and dangerous permissions.

A normal / dangerous permission can modified if it is marked as
optional (android:required="false") using the "am grant" / "am revoke"
commands.

Currently, this change is a no-op. The package parser code
does not currently honor <uses-permission android:required="false"> in
the application's manifest, and assumes a permission is always required.

This change sets the ground for future optional permissions work.

Change-Id: I34f02ffd714e8a9a37b9f87df89cef915b1b6780
2013-03-25 11:01:20 -07:00
rpcraig
1e0c8e6989 Proper security labeling of multi-user data directories.
This patch covers 2 cases. When an app is installed
and the resulting data directory is created for all
existing users. And when a new user is created and
all existing app data directories are created for
the new user.

Change-Id: Iacaba6d9d18d5337e65713960d14efe32006b330
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
2013-03-25 14:35:00 +00:00
Robert Craig
d3f8d0333c Add seinfo parsing to PackageManagerService.
This patch set allows the PMS to parse the
mac_permissions.xml file which contains the
seinfo values. Each package that is installed
on the device will be assigned an seinfo value
based on policy. This seinfo value will help label
the app process and data directory.  Modifications
include adjustments to ApplicationInfo.java
to store the seinfo tag per package as well as
adjustments to installd to communicate the seinfo
tag to libselinux.

Change-Id: I61ad1ea12fb6a9a6d0b108ec163bc4bf4c954b58
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
2013-03-25 06:33:03 -04:00
Dianne Hackborn
b685faa2ce Merge "Implement #8323587, #8323342, #8323590: new features." into jb-mr2-dev 2013-03-23 01:26:08 +00:00
Dianne Hackborn
119bbc378d Implement #8323587, #8323342, #8323590: new features.
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-22 17:27:25 -07:00
Svetoslav
320a31c604 Merge "Incorrect unbinding of accessibility services." into jb-mr2-dev 2013-03-23 00:14:43 +00:00
Svetoslav
cefac5acc8 Incorrect unbinding of accessibility services.
If no accessibility services are enabled, we disable the
accessibility event firing to save resources. When the last
such services is disabled the system was not unbinding. As
a result the user was seeing the touch exploration enable
dialog when the service that requested it is disabled. Also
there is one service the system is bound to that is not used.

bug:8439191

Change-Id: I6f37f2573a815bfb29870298aa0abbb1fa105588
2013-03-22 17:13:01 -07:00
Craig Mautner
5341f377cc Merge "Reduce situations where black thumbnail occurs." into jb-mr2-dev 2013-03-22 22:51:57 +00:00
Jeff Sharkey
9da8c37ab8 Merge "Move XML utility methods into shared location." into jb-mr2-dev 2013-03-22 20:45:17 +00:00
Jeff Sharkey
ded7b75d1a Move XML utility methods into shared location.
Change-Id: I15e8f0e4a6c5546d9be956ca0d46715d3441458c
2013-03-22 13:43:41 -07:00
Craig Mautner
24d88747e9 Reduce situations where black thumbnail occurs.
Pause and retry capturing a thumbnail if the window hasn't yet
been drawn. Still will show black thumbnails if recents is pressed
before window has anything drawn.

Improves bug 7552304.

Change-Id: I550c5a60510bfc4547bbb44451d57b4bc9f49880
2013-03-22 12:07:51 -07:00
Svetoslav
a7452ee27d [DO NOT MERGE] Notify vold when to start fstrim.
Since using the discard option for mounting an Ext4 file system
could lead to unpredictable slowdowns of I/O we will explicitly
control when to perform fstrim, i.e. discard unused blocks of the
mounted volume. We are using the idle maintenance intents sent by
the system which specify a window that one can use to perform
expensive maintenance tasks while the user does not use the device.

This change is adding a broadcast receiver for the idle maintenance
start intent to the mount services which then notifies vold when to
start fstrim.

Since fstrim will be run on a daily basis we do not expect fstrim
to be too long, so it is not interruptible. We will implement
interruption only in case we see issues.

bug:8056794

Change-Id: I1438479d2956b61b82d3a130854376f7a144aaf3
2013-03-22 10:42:24 -07:00
Lorenzo Colitti
31453e5a2b Merge "Reset connections on all stacked interfaces." into jb-mr2-dev 2013-03-22 09:45:53 +00:00
Michael Wright
765ddb4bf4 Merge "Separate sessionCreated and finishedEvents callbacks" into jb-mr2-dev 2013-03-22 03:36:49 +00:00
Jeff Sharkey
6848963d81 Merge "Round up periodic syncs with short frequencies." into jb-mr2-dev 2013-03-22 01:18:38 +00:00
Jeff Sharkey
6009459405 Round up periodic syncs with short frequencies.
Bug: 7668972
Change-Id: I476ded1418a203621913098cf5d33a4e5dc533ee
2013-03-21 18:18:13 -07:00
Michael Wright
52a5352626 Separate sessionCreated and finishedEvents callbacks
Bug: 8276952
Change-Id: If7051086c060fcce5d1e958ebbddec0784c851da
2013-03-21 17:47:40 -07:00
Daniel Sandler
dc0299fb23 Merge "Allow whitelisted non-system packages to listen for notifications." into jb-mr2-dev 2013-03-21 22:01:59 +00:00
Dianne Hackborn
c3ab03a9f2 Merge "Fix issue #8436951 JB-MR2: Compatibility: Audible, Pandora, ..." into jb-mr2-dev 2013-03-21 21:55:53 +00:00
Dianne Hackborn
2ced96c544 Fix issue #8436951 JB-MR2: Compatibility: Audible, Pandora, ...
...Tune-In does not work since JWQ77

Instead of crashing the app for it being bad, just go ahead and
show a notification for it anyway that we make up.

You get what you deserve. :p

Change-Id: I92e32b9ff8835dabde63f8e08e991f72de0d0a92
2013-03-21 14:23:46 -07:00
Irfan Sheriff
7b7beb7952 Notify user when wi-fi is toggled about scans
We let the user know when he turns off Wi-Fi that scans will continue to
be available.

User has the option to turn off the dialog and not receive this in the future.

Bug: 8141918
Change-Id: I115ce2ac57125b8ffbb34245dc25effd4b3bebb0
2013-03-21 12:27:20 -07:00
Daniel Sandler
4b749ef5f2 Allow whitelisted non-system packages to listen for notifications.
The allowed packages are listed in
Settings.Secure.ENABLED_NOTIFICATION_LISTENERS. (Don't let
the plural fool you: only one listener will be supported in
the UI.)

Change-Id: Ia69f2ba05d8e555fd4d40b0cc89c62ed14af3cac
2013-03-21 01:41:20 -07:00
Amith Yamasani
d4f8800801 Merge "Application restrictions API" into jb-mr2-dev 2013-03-21 06:12:38 +00:00
Wink Saville
4deaf8934b am 6837f4a4: am e4679750: Merge "Fix Watchdog HeartbeatHandler to run on correct thread"
* commit '6837f4a44235f96d410190806448ddf43d2fe696':
  Fix Watchdog HeartbeatHandler to run on correct thread
2013-03-20 22:42:19 -07:00
Amith Yamasani
df2e92a535 Application restrictions API
Adds the ability for apps to export some restrictions. The restrictions
are presented in Settings based on the restriction type. The user's
selections are stored by UserManagerService and provided to the
target user's application as a list of RestrictionEntry objects which
contain the key, value(s).

Also introduce a manifest entry for system apps to request that the
app be automatically installed in all users, so that they cannot be
deselected by the owner user.

Shared account filtering for non-whitelisted apps.

Change-Id: I15b741e3c0f3448883cb364c130783f1f6ea7ce6
2013-03-20 22:29:59 -07:00
Irfan Sheriff
63f1e2fb6b Merge "Add API to control scan always mode" into jb-mr2-dev 2013-03-20 15:49:20 +00:00
Lorenzo Colitti
4aa9bcf414 Reset connections on all stacked interfaces.
Bug: 8276725
Change-Id: I7fe99c6ea123037cef3e89e3c2c17ed43cc0b1ea
2013-03-20 19:22:58 +09:00
Irfan Sheriff
9f3d55056f Merge "Fix reading sleep policy" into jb-mr2-dev 2013-03-19 22:48:13 +00:00
Irfan Sheriff
9f2e83135c Fix reading sleep policy
Bug: 8418823
Change-Id: I432b0a1a7a13dcdd834f6a1c943b06937444f406
2013-03-19 14:32:11 -07:00
John Michelau
116415271b Fix Watchdog HeartbeatHandler to run on correct thread
The HeartbeatHandler for the System Server Watchdog has been running
on the wrong thread due to a race condition in initialization.  It's
designed to run on ServerThread, so that it can catch lockups in the
main looper of the System Server.  It has been running on
ActivityManagerThread instead, so it does not detect lockups on the
ServerThread as it should.

ActivityManagerService is calling Watchdog.getInstance() before
ServerThread calls Watchdog.getInstance().init(), so the handler is
being bound to the ActivityManagerThread instead of the ServerThread.

Explicitly bind HeartbeatHandler to ServerThread, so that the Watchdog
catches lockups on this critical thread.

Change-Id: Iccb184ac3adb817feb86ed4ee0e50e443bf74636
2013-03-19 14:39:33 -05:00
Elliott Hughes
6d3b13384e am c9fe40ea: am 71558f1f: Merge "Fix times in debugging output to use H rather than k."
* commit 'c9fe40ead549ff18393c0cc5c6e3bd67548f9da6':
  Fix times in debugging output to use H rather than k.
2013-03-19 10:13:34 -07:00
Nick Kralevich
515c20beb1 Merge "PackageManagerService: honor requestedPermissionsRequired" into jb-mr2-dev 2013-03-19 15:45:23 +00:00
Irfan Sheriff
1ef840cdc7 Add API to control scan always mode
Bug: 8141918
Change-Id: I1e5e45e514726c2cbfd86e747123e477e00fd7ed
2013-03-19 07:44:47 -07:00
Craig Mautner
aea8b0e571 am 7f7ac5b4: am fda1bff8: Merge "Correct the target app token for input method window"
* commit '7f7ac5b4a86be479bdede226fd4a2bddcd8a9a2b':
  Correct the target app token for input method window
2013-03-18 17:50:32 -07:00
Elliott Hughes
64a277d837 Fix times in debugging output to use H rather than k.
Bug: 8359981
Change-Id: I4fccf3ed7e469b77f6e755dacbcd025005390505
2013-03-18 17:47:22 -07:00
Nick Kralevich
1cd6c6ecdf PackageManagerService: honor requestedPermissionsRequired
Don't automatically grant all normal/dangerous permissions. Instead,
check the value of requestedPermissionsRequired to see if it's required.

If the permission is not required, then only grant it if the permission
was previously granted to the application.

Change-Id: I86b1fae530c006d353f9fa22137598bc88253805
2013-03-18 13:59:04 -07:00
Craig Mautner
2fc8ad1fe6 Merge "Properly close Surface when done." into jb-mr2-dev 2013-03-18 20:57:26 +00:00
Craig Mautner
e50d7fcd97 Properly close Surface when done.
Surface.destroy was not being called. Leading to warning from
StrictMode.

Fixes bug 8388527.

Change-Id: I472fb57ed2c3f6389e53d8f020f3b22b2d0740c8
2013-03-18 10:06:21 -07:00
Lorenzo Colitti
952e4805f7 Merge "Framework changes for 464xlat." into jb-mr2-dev 2013-03-18 16:41:58 +00:00
Carrie Xu
5c97184c3a Correct the target app token for input method window
The root cause is:
There is a defect in window manager service: When a new
activity that can be ime target is added into window manager
but the Z order of input method window don't need to be
changed, then the target app token of input method window
would not be updated to new one. This defect may cause that
the layer of input method window is calculated incorrectly.

The solution:
Correct the target app token for input method window.

Change-Id: I008311e3c9b1cf5fc320b614d8675c183c506d50
2013-03-18 11:45:14 +09:00
Lorenzo Colitti
d9b3d55152 Catch RuntimeException in NMService notifications
Currently, NetworkManagementService only catches RemoteExceptions
when calling the BaseNetworkObserver notification methods (e.g.,
interfaceStatusChanged). However, if the observer is in the same
process, unchecked exceptions can occur as well.

When this happens, finishBroadcast does not get called, and no
further notifications can be sent, because any attempt to do so
fails with a "beginBroadcast() called while already in a
broadcast" exception.

Fix this by catching RuntimeException as well.

Bug: 8397534
Bug: 8276725
Change-Id: Icd6f32128707244978943c48a9ea3a2b952a2957
2013-03-17 03:21:35 +09:00
Dianne Hackborn
bb131f52da Merge "Fix issue #8401553: It's possible to startForeground()..." into jb-mr2-dev 2013-03-16 01:59:29 +00:00