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
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
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
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
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
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
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
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)
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]
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)
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)
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)
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
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
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
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)
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
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
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
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
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
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)
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
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
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
Send a POWER_HINT_INTERACTION to improve redraw performance when the
phone is rotated.
bug 24583227
Change-Id: I1978f0dfb9a25c00ad4da5b44d10410ad7412001
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