10260 Commits

Author SHA1 Message Date
Lorenzo Colitti
809dcade99 Merge "Reinstate CHANGE_NETWORK_STATE as a normal permission." into mnc-dr-dev 2015-10-22 06:15:05 +00:00
Dianne Hackborn
865907db09 Hopefully fix issue #25153459: Sandboxed_process1 thrashing
There is a race where if you unbind to a service before its
process has come up, we would leave the service record active
and keep it running.  Fix this by checking the service state
after its process up and proceed to bring it down if it is no
longer needed.

Also added a similar check when restarting a service, just in
case there are other ways we can get into this situation.

And while I am at it, I tweaked the broadcast queue dump output
a bit to hopefully make it a lot easier to figure out how long
it is taking to process broadcasts.

Change-Id: I46b98f1fe394ab8039ea4cc81fb5d3afb6391a31
2015-10-21 17:15:37 -07:00
Lorenzo Colitti
d542705066 Reinstate CHANGE_NETWORK_STATE as a normal permission.
This is a partial revert of http://ag/738523 , but not a full
revert because M apps that have gone through the WRITE_SETTINGS
route to obtain permission to change network state should
continue to have permission to do so.

Specifically:

1. Change the protection level of CHANGE_NETWORK_STATE back from
   "signature|preinstalled|appop|pre23" to "normal". This allows
   apps that declare CHANGE_NETWORK_STATE in their manifest to
   acquire it, even if they target the M SDK or above.
2. Change the ConnectivityManager permission checks so that they
   first check CHANGE_NETWORK_STATE, and then ask Settings
   if the app has the WRITE_SETTINGS runtime permission.
3. Slightly simplify the code in the Settings provider code that
   deals specifically with the ability to change network state.
4. Make the ConnectivityService permissions checks use the
   ConnectivityManager code to avoid code duplication.
5. Update the ConnectivityManager public Javadoc to list both
   CHANGE_NETWORK_STATE and WRITE_SETTINGS.

Bug: 21588539
Bug: 23597341
Change-Id: Ic06a26517c95f9ad94183f6d126fd0de45de346e
2015-10-22 08:33:45 +09:00
Todd Kennedy
0cd10ec8cf Merge "Maintain shared user list on OTA" into mnc-dr-dev 2015-10-21 20:33:31 +00:00
Todd Kennedy
68f6715bb2 Maintain shared user list on OTA
When a package is removed during an OTA, we weren't removing it from the
shared user list. This means anyone asking for the packages for a shared
UID would continue to see the old package.

Bug: 24906701
Change-Id: Ifb6d64195e6b8af7454e19591611af66a40cbd10
2015-10-21 13:22:01 -07:00
Jeff Sharkey
052366ca4e Narrow permission re-granting to specific volume.
When mounting a storage volume after an SDK upgrade, the platform
grants install permissions requested by apps.  This patch fixes a
bug that was causing us to re-grant permissions for all installed
apps; we now narrow the granting to just the storage volume of
interest.

Also fixes a bug where scanning of internal ASECs would bump the
VersionInfo of the legacy apps-on-SD volume.

There is still a bug here around internal ASECs not being considered
for re-grants, but that needs to be fixed in a more invasive CL that
creates a separate VersionInfo.  In addition, internal ASECs (also
known as forward locked apps) have been deprecated for some time.

Bug: 24583803
Change-Id: I9115fd484ec083bc10a970f5f612860d5a53e520
2015-10-21 10:42:14 -07:00
Paul Lawrence
68521fd7ce Merge "Don't include password on default encryption command" into mnc-dr-dev 2015-10-21 14:27:33 +00:00
Lorenzo Colitti
d214496319 Merge "Don't buzz when automatically connecting to captive portals" into mnc-dr-dev 2015-10-21 01:10:10 +00:00
Lorenzo Colitti
46d50b708d Don't buzz when automatically connecting to captive portals
Play a sound and vibrate (by setting DEFAULT_ALL) only if the
user manually selected the network. This applies to both captive
portals and networks with no Internet access.

Bug: 24126143
Change-Id: Idf075d5c85f9f4b07a3431a25d1a3f7089cf1ee2
2015-10-21 09:59:31 +09:00
Jeff Sharkey
55d2b6e8e6 Merge "Correctly derive ABI for apps on adopted media." into mnc-dr-dev 2015-10-21 00:48:47 +00:00
Jeff Sharkey
bbcb331205 Correctly derive ABI for apps on adopted media.
There was a bug causing PackageManager to think apps on adopted media
were actually in an ASEC, causing it to skip ABI derivation.  This
change fixes the issue by copying the volume UUID into place early
in the scanning process.

Also fixes two places where we had incorrectly been including apps
on adopted media; switched them to check only for ASECs.

Bug: 24583803
Change-Id: If66d1bce02824a4d8e22f741b04a2abda0378cfb
2015-10-20 17:32:05 -07:00
Rob Carr
9ada400e98 Merge "Catch exceptions thrown by pending activity launches." into mnc-dr-dev 2015-10-20 23:30:12 +00:00
Kevin Cernekee
3554d62ca0 Merge "ignore initial request to disable iptable chain" into mnc-dr-dev 2015-10-20 22:11:29 +00:00
Robert Carr
f1ddb5e090 Catch exceptions thrown by pending activity launches.
When we perform pendign activity launches from the handler
thread (as opposed to the a client binder thread), we must
take care exceptions from such will not bring the system
server down.

Bug: 24983901
Change-Id: I0e75f6b51bf6172a8e1b9cccc5fffb9d50c63e30
2015-10-20 21:51:26 +00:00
Matthew Williams
f5e045254a DO NOT MERGE Race condition in JobServiceContext
BUG: 23981171
JobServiceContext has a reference to the running job which
1) needs to be copied before providing access to outside callers
2) was not guarded by a lock in one case which might result in an NPE

Change-Id: I7eb04052f3fe63e7b386c564a6bdebf9144e976a
(cherry picked from commit 0cc7654e109d232e5d9a9de06482d8d349a21f28)
2015-10-20 21:44:26 +00:00
Xiaohui Chen
690f18a564 ignore initial request to disable iptable chain
iptable child chains are disabled by default.  Ignore the initial
disable request so netd won't throw errors when it cannot detach chains
that do not exist.

Bug: 22800189
Change-Id: I70b4b8b9e6a5dbffe32841941922b7fd92dcd3d6
Original-Change-Id: I9312dd558ba6d59dc6aa394afeb66a222daafcf9
[cernekee: backported from master branch]
2015-10-20 13:55:33 -07:00
Matthew Williams
7d7a2254bc DO NOT MERGE Sync extras bundle comparison can throw NPE
BUG: 23591205
Change-Id: Ic6404c0befe70c34b078e0eae6a627826173d82c
(cherry picked from commit 9ad2c8403354a985258c098681067e74b9e2f638)
2015-10-20 18:55:30 +00:00
Michael Wright
57a5cba606 Merge "Add SystemUI component to watch for keyboard attachment." into mnc-dr-dev 2015-10-20 15:31:01 +00:00
Matthew Williams
1f0ec16b6d DO NOT MERGE Sanity check loaded periodics and cap runtime.
BUG: 24900376
We've seen an issue where periodic run times can be massively
inflated after loading from disk.
As a safeguard, cap the period's loaded runtime to be [p, 2p]
from the time of loading.

Change-Id: Ie4464490c8d6702fee8efe9190c3da5dc5f013f6
(cherry picked from commit fa8e5084eed63ab8d92c71fcff656690a30293c3)
2015-10-16 21:56:55 +00:00
Matthew Williams
b91987634b DO NOT MERGE Change scheduling logic to run network jobs sooner
BUG: 24385082
BUG: 23144425
BUG: 18117279

Run jobs with connectivity constraints as soon as the developer-allotted
delay has expired, rather than waiting for the override deadline. This
is more in tune with what developers expect, although it reduces the
amount of batching the scheduler can theoretically do.
This will also have the side effect of fixing several failing cts
tests that started breaking b/c the signal to 'run connectivity
jobs early' was removed in M and nothing was put in to replace it.

Change-Id: I7e63c2b62f2882ee906f748445bbf10c32e19c5f
(cherry picked from commit aa9843198dec910a581bdc509d3937a9ea6ceca9)
2015-10-15 23:33:06 +00:00
Dianne Hackborn
56f4197148 Merge "Fix issue #24571425: Device does not come out of idle mode for maintenance" into mnc-dr-dev 2015-10-15 23:11:12 +00:00
Dianne Hackborn
f383129b09 Fix issue #24571425: Device does not come out of idle mode for maintenance
Don't allow alarms to push the idle maintenance alarm later
than it was set for.

Change-Id: I947718ffc9d2b984a793d7e4f2d027d8ddeee41b
2015-10-15 14:51:06 -07:00
Robert Carr
38451b8247 WindowStateAnimation: Clear transformation clip rect.
Ensure the clip rect taken from transformations is cleared
when there is no transformation. Normally the failure to
clear the clip would not cause a problem, as the final clip
would be equal to the window size. However, in the event that
the window scale goes on to change (WindowState::m(H/V)Scale that is)
the clip will now be specified at the inappropriate scale (notice the
way the clip must be divided by H/VScale as SurfaceFlinger will apply
the surface transform to the clip).

Bug:24298694
Change-Id: I4548e8ecea8d66d4942e99823653a7b05f87cea0
(cherry picked from commit 2f0fe62c5426533ccdf9ec7ef28027c367286979)
2015-10-15 00:53:35 +00:00
Erik Kline
b7e722b88f Merge "Don't crash if an invalid always-on VPN profile is configured." into mnc-dr-dev 2015-10-14 17:37:57 +00:00
Matthew Williams
40ec3a9246 Merge "Correctly reschedule failed periodic" into mnc-dr-dev 2015-10-14 03:00:16 +00:00
Michael Lentine
50e796326a Merge "Remove ColorFade resouces when screen off." into mnc-dr-dev 2015-10-13 22:51:12 +00:00
Michael Lentine
d73854dbfd Remove ColorFade resouces when screen off.
This will not destroy the surface but will free up everything else used by
ColorFade when the screen is turned off. When it is turned on the surface is
dismissed.

Bug: 24371570

Change-Id: Iba455cdf225a68b320896f8b35d1e873e694b1e3
2015-10-13 14:35:18 -07:00
Jeff Hao
71d3260ffa Shorten first boot time by filtering dexopted apps by LRU.
No longer dexopt all system apps and boot listener user apps.

Bug: 23628238
Bug: https://code.google.com/p/android/issues/detail?id=186589

(cherry-picked from commit b84cb9e9719855d56ea74c2eb7afc49034c0e66f)

Change-Id: Id1a1ca9f46777f9e62df3d4f25e98a2837fabf37
2015-10-13 17:49:15 +00:00
Lorenzo Colitti
9b23f88552 Don't crash if an invalid always-on VPN profile is configured.
This is currently being hit because Settings does not clear the
always-on VPN configuration when the corresponding VPN profile is
deleted. This will be fixed in Settings, but there's no harm in
being robust to invalid configurations here.

Bug: 23625458
Change-Id: Id185a54d5892339197cd40026df5174debd957cf
2015-10-13 15:29:14 +09:00
Yohei Yukawa
ce42e92219 Merge "Unbind IME client when unsetting the current IME." into mnc-dr-dev 2015-10-13 01:00:30 +00:00
Yohei Yukawa
739d0b0585 Unbind IME client when unsetting the current IME.
This follows up Ia70b870723acf647e0c27f24aff91b40d6f85543.

In certain scenarios, only IMMS#mCurMethodId is cleared with null
while IMMS#mCurClient is still pointing to the last application.
This is problematic when IMMS#mCurClient matches
SystemConfig#getFixedImeApps(), because it means that the current
IME is to be fixed to null.

With this CL, IMMS#unbindCurrentClientLocked() is always called
every time when IMMS#mCurMethodId is cleared to null.  Note that
clearing IMMS#mCurMethodId to null is a kind of hard-reset, where
unbinding IME client should make much sense in terms of robust
and predictable state management.

Bug: 18056075
Change-Id: I6c3186050592526fc95c5b27f18e2155acff5ebc
(cherry picked from commit e13a20faccf6f33aa43c9c1fa4c4ec2a79b86cfb)
2015-10-12 17:08:59 -07:00
Svetoslav
ff7b92fc02 Shared user retains permissions no longer used by any app on an app update
If an app in a shared user uses permission A and B and these are granted
to the shared user and now an app update is installed that only uses A,
the shared user still ratains the B grant. A shared user should have only
permissions declared as used by its currenlty installed apps.

bug:24736912

Change-Id: Idea6c06bdc236fd481a860cddb379e6ce660ee87
2015-10-12 16:04:34 -07:00
Dianne Hackborn
6cc3735a49 Merge "Fix issue #23581553: Ignore Battery Optimization not work for re-install app" into mnc-dr-dev 2015-10-12 19:11:46 +00:00
Dianne Hackborn
1b79ad74ef Fix issue #23581553: Ignore Battery Optimization not work for re-install app
Remove from whitelist as appropriate.  Also be sure we can find whitelisted
apps even if they are not installed in the primary user.

Change-Id: I3ed13dca99b3ba177af8f7bd26a75258df9b6949
2015-10-12 10:59:47 -07:00
Wale Ogunwale
5c18d05177 Use effectiveUid instead of callingUid to set lockTaskMode
The callingUid can be different from that of the app been locked
(e.g. was launched from launcher) there by leading to the app crashing
when it tries to exit lockTaskMode.

Bug: 24146132
Change-Id: I03346fabd1d7e61b29178220c72f747a0600f5ec
2015-10-12 17:40:56 +00:00
Jeff Sharkey
a03ecf7d7c Merge "Push firewall rules up to ConnectivityService." into mnc-dr-dev 2015-10-12 16:34:19 +00:00
Vinu Deokaran
6be61a98fc wm: call displayReady for all built in displays when system is ready.
When system has more than one built in display, displayReady needs
to be called for all built in displays when window manager is ready.
Otherwise, some system services, such as presentation, mediarouter,
etc, won't work on these displays.

Bug: 24103683
Change-Id: Ibf08074eff555c14a318236bd06e7b4855503140
2015-10-12 16:00:54 +00:00
Michael Wright
9209c9cd9a Add SystemUI component to watch for keyboard attachment.
Add a new SystemUI component to watch for keyboard attachment /
detachment. If the config specifies the name of a keyboard that is
packaged with the device, then SystemUI will ask the user if they
would like to enable BT (if disabled) and then attempt to pair to the
device.

Bug: 22876536
Change-Id: I786db35524d49706d5e61d8b8bc71194d50113f3
2015-10-12 15:21:37 +01:00
Matthew Williams
d6af66e89d Correctly reschedule failed periodic
BUG: 24341715
Failed jobs are rescheduled with no override deadline to avoid
running a failed job with unsatisfied constraints.
A periodic job always has an override deadline and the periodic
rescheduling code assumes this.
Hence a periodic that failed until eventual success would be
rescheduled in a bad state.

Change-Id: Id110b3522df2003506a9efdde4e719e1b9932106
(cherry picked from commit 1bde39ad1424008917e1191565f81e0b4617f2fa)
2015-10-07 23:03:41 +00:00
Eric Laurent
2a6f1d4af3 Merge "ZenModeHelper: fix cross deadlock with AudioService" into mnc-dr-dev 2015-10-07 13:39:51 +00:00
Jean-Michel Trivi
0155856a1d Fix AudioService rotation helper thread
Fix a race condition where the wait index can be incremented inbetween
  the while() loop and the lock
Fix when updateOrientation() is called: after the sleep, otherwise
  the last sleep is useless.

Bug 24677424

Change-Id: I03770a0fc8af57f4696ebee7e9c9110e17c55a24
2015-10-05 15:26:21 -07:00
Eric Laurent
e0ced4da19 ZenModeHelper: fix cross deadlock with AudioService
Processing ZenModeHelper.setConfig() synchronously in
ZenModeConditions.onConditionChanged() can cause a cross deadlock between
ConditionProviders.mMutex and AudioService.mSettingsLock.

Add a method to set Zen mode config asynchronously.

Bug: 24528290.
Change-Id: I9c1701ca6bef084527821175d84002b612241995
2015-10-05 10:43:52 -07:00
Tim Murray
791763796e Merge "Send POWER_HINT_INTERACTION on rotate." into mnc-dr-dev 2015-10-02 20:43:30 +00:00
Jorim Jaggi
8c66fa9436 Merge "Add minimum time for double tap gesture" into mnc-dr-dev 2015-10-02 19:55:26 +00:00
Jean-Michel Trivi
24806db8f6 AudioService: alternative way of handling device rotation
For devices that monitor orientation (primarily for channel assignment
 to stereo speakers):
The com.android.server.policy.WindowOrientationListener API is more
 power efficient than simply monitoring the device's orientation. When
 supported, use it instead of android.view.OrientationEventListener.
When WindowOrientationListener reports an orientation change, start
 a thread to poll the UI orientation, as its change may lag behind
 the observed rotation. Gradually increasing delays between polls
 are stored in a table.

Bug 24415763

Change-Id: I69bf68da6107af24cd02a48961dd17ceab557816
2015-10-01 18:40:26 -07:00
Tim Murray
1f407647d1 Send POWER_HINT_INTERACTION on rotate.
Send a POWER_HINT_INTERACTION to improve redraw performance when the
phone is rotated.

bug 24583227

Change-Id: I1978f0dfb9a25c00ad4da5b44d10410ad7412001
2015-10-01 17:07:12 -07:00
Jorim Jaggi
d3f84d4a9a Add minimum time for double tap gesture
Bug: 24304031
Change-Id: I15629d6b05175aea9b0d02571f6245966094f162
2015-10-01 14:13:04 -07:00
Jorim Jaggi
ea9675e7aa Merge "Do not issue config change command when not needed" into mnc-dr-dev 2015-09-25 06:54:42 +00:00
Pankaj Kanwar
65bfe1cac3 Merge "AudioService: cleanup sco audio mode upon disconnection." into mnc-dr-dev 2015-09-25 04:40:23 +00:00
Eric Laurent
48221250ba AudioService: cleanup sco audio mode upon disconnection.
Clean up SCO forced usage and A2DP suspend state upon
SCO device or profile disconnection.
This is in case the Bluetooth Headset service does not
do it.

Bug: 24316765.
Change-Id: Ifc0305607c186be49b2eb42b7868647292e56137
2015-09-24 18:41:48 -07:00