We generally dispatch while the display is off and we're dozing,
under the assumption that the dozing window is controlling the
display state and wants the events as they come in. Unfortunately,
it's possible that we're dozing but something other than the dozing
component has focus, which leads to dropped and cancelled events.
This was preventing media events from being propogated to the media
session under a number of scenarios, so for now we'll just prevent
dispatching entirely while the display is off and the device is in a
non-interactive state. Going forward we should figure out a better
solution so that doze components can continue to receiving input
events throughout their lifecycle, regardless of the display state.
Bug: 22422588
Change-Id: Ia38bd81245234743e84548841d6478f75a6b8775
When renaming a package during an OTA we were getting in a state
where the package setting mapped to the package UID was not the
same instance as the one we create for the new package mapped.
This leads to a drift between the permissions state for the package
and that state for the UID, resulting in broken for UID permission
checks as granted permissions were never appearing in the per UID
package setting.
bug:22928831
Change-Id: Ib0372632ec84a917304561fd94032cd09bb4c12f
As discussed in b/21429947 (commit
674019065bceb4150190bfb1aa63cda9de0a8560), MTP must always be
enabled, even if access to the underlying MTP data is disabled.
Otherwise, Android will not enumerate on the USB bus, and won't
receive notifications from the kernel about USB state changes. This
effectively prevents using MTP functionality on user builds, or
on userdebug/eng builds with adb turned off.
Always ensure that MTP is the default driver mode.
Move the DISALLOW_USB_FILE_TRANSFER filtering of mUsbDataUnlocked from
setting time to the time we post the sticky broadcast.
Remove isUsbDataUnlocked(). It essentially duplicates data in the sticky
broadcast.
Bug: 22447614
Bug: 21429947
Change-Id: I9d0d94cadbf6db6281ebd77bfb7162f9d06520c2
Temporarily revert ag/735253 until b/22902898 can be resolved with a
proper DMAgent prebuilt drop.
This reverts commit e7ed827a104ba005b93faa2edb3bc77f72b240ec.
Bug: 22902898
With this change:
1. NOT_RESTRICTED should be removed from NetworkRequests that bring up
special restricted carrier networks (e.g. IMS, FOTA).
2. NetworkRequests without NOT_RESTRICTED require CONNECTIVITY_INTERNAL
permission to register
3. Binding sockets to networks without NOT_RESTRICTED requires
CONNECTIVITY_INTERNAL permission
Bug:21637535
Change-Id: I5991d39facaa6b690e969fe15dcbeec52e918321
During error recovery, if the mBluetooth pointer is reset to null,
reset the mBluetoothGatt pointer as well.
Bug: 21756298
Change-Id: I26204ba47dd3c5465bb7de30cfa5dc0f07eee2fd
Derive the correct current volume UUID for comparison, and only
check for cluster style installs when moving from internal storage.
Bug: 22616484
Change-Id: Idb6be2aa4aaa9b9f47ebbeeebd65c15a60d5d164
BUG: 22287469
1) Fix SyncManager waking up every 2 hrs if there is nothing
to do.
2) Fix sync wake-up alarm not being properly updated if the new
alarm was in the future.
2a) Due to staus bar sync signal that were removed post-K
one of the wake-ups was for 30s in the future, removed this
@hide intent completely.
3) The SyncManager will still set a timeout alarm for 5mins after
the start of a sync. Leaving this in as to post to a handler is
less expensive but more complex, and the alarm update is
correctly working now.
Change-Id: If51c9dd68391ccaeb480a17eb5a1364c4afe4c2a
Add new Activity.isVoiceInteractionRoot() API that an activity can use
to determine whether it is the root activity of a voice interaction
session started by the user's designated voice interaction service.
This is a special new API that apps must explicitly check, because as
with visual activities the model behind an activity should usually be
that it accomplishes its task by interacting with the user (implicitly
getting their approval) rather than trusting that whoever invoked it
is telling it to do what the user once. In the voice world, however,
there are some cases where quick interactions want to allow for immediate
execution without further user involvement, so this API allows for that
without opening up security holes from other applications.
Change-Id: Ie02d2458f16cb0b12af825641bcf8beaf086931b
When we are cleaning up broadcat receivers due to a package been
disabled, it is possible to remove enough recievers to cause the
nextReceiver index to be greater than the size of recievers list.
We now set the nextReceiver to the size of the receiver list
(which means done processing) for this case.
Bug: 22874330
Change-Id: Ie151d1b5bff4c11533b3a8635fe5ee82eb21c13c
When connecting/disconnecting and audio device, AudioService
was assuming that the call was always successful through
AudioSystem.setDeviceConnectionState(). In the case of the
connection of a wired headset (mic + headphones), this also
causes A2DP to not be used for media playback.
The connection can fail if the audio device being connected
is not supported by the platform. But if this failure is
not taken into account for DEVICE_OUT_WIRED_HEADSET or
HEADPHONES, A2DP would still be avoided even when an A2DP
device reconnects at boot.
The fix consists in executing the connection logic only when
the connection was deemed successful. Nothing is altered
on the disconnection code path, or the direct connection
of A2DP.
The javadoc is updated in AudioSystem to indicate the return
codes to take into account in setDeviceConnectionState().
Bug 22511833
Change-Id: I22f0d2c7d4ab4fb9ee1be2f248907f721596a16f
We can end up in a rare tangled mess when sending broadcasts while
PackageManager is still trying to deal with scanAvailableAsecs().
Long-term solution is to make Environment.isExternalStorageEmulated()
more robust, but for now we just send these internal broadcasts
after we drop the MountService lock.
Bug: 22858403
Change-Id: I7b43865782f48a679882fd1675b7b961e1292df4
7cbfcd88657ac7d5ab1baf8c964b669c9bd21e24 we stopped comparing
the tasks realActivity when trimming recent task. This led to
task with the same intent been duplicated in the recents list.
We now consider the task intent when deciding when to trim like
we did pre 510e554283d3dc250f836cd3e4abc36d87319333.
Bug: 22812470
Bug: 22564474
Bug: 18642190
Change-Id: I90b3ab9cf7a06b4691099f697e723d8a54def9fa
The app ops mananger service maintains a mapping from UID to
a list of packages where each package is mapped to a list of
non-default app op states (default states are inferred and
not stored). Hence, specifying the app op state for a UID
requires setting the app op for each package in the shared
UID.
This is problematic when installing new packages if there
is a non-default app op policy set for another already
installed package in the same UID as the app op for the new
package has to be updated to be in sync. The package installer
cannot do this as it is in another process and the app op
update will not be atomic. Therefore, the app ops manager
service has to support specifying app op policy on a per
UID basis.
We now have a UID state object that contains the per package
non-default app op states as well as the per uid non-default
app op states. If there is a UID policy specified then it
takes precedence over the per package one. Even further,
changing the uid policy updates the package policies in this
UID if the state is non-default. Changing a package app op
state also updates the app op state for the whole UID if
the per UID policy for this op is non-default. Clearing the
app op state for a package, clears the policy for the UID
as well.
bug:22802981
Change-Id: I78044906d9fcc6066abf07e706c2c88f3397d293
This fixes the bug where launcher icons become temporarily visible when
home button is pressed while other activity is starting. By having the
starting activity's animation be zoder top, it will continue to be drawn
on top of the launcher until it animates away.
Bug: 22809202
Change-Id: If5e3c09b7a5df4537c355f94e986766f77ad4943
Reproduce sequence:
1. Change ring volume to vibration in Settings > Sound & notification
> Ring volume using touch
2. Launch camera app
3. Capture, but cannot hear shutter sound
4. Even change ringtone to maximum, shutter sound is not played before reboot
Bug: 22589664
Change-Id: I90eb044eaf21f3b558bf050bf1d9f0b33ea4888b
A device owner cannot use device or profile owner policies on
other users unless it is profile owner there. Also limit device
initializer to system apps only.
Bug: 21800830
Change-Id: Ie1abbd891945b91b17ecdf7f73ba93aaa19819be
It is possible to get some artifacts during scale-up transition
animation of some fullscreen activities like Chrome. This is
caused by the clip rect specified by the transformation extending
outside the sys decor rect. We now contain the clip rect within
the system decor rect.
Also note that we don't want to do this for none-fullscreen
activities as it might cause some premature clipping.
Bug: 22830775
Bug: 21727851
Bug: 20652683
Bug: 19523205
Bug: 15046646
https://code.google.com/p/android/issues/detail?id=161362
Change-Id: I33827caaa256ad8fdc0eb3650ef34e95c48a6988
The methods startUsingNetworkFeature, stopUsingNetworkFeature and
requestRouteToHost were @removed in all the M preview builds, but
internal and external developers have noted that this imposes
additional burden for applications that need to work across
multiple platform versions because it causes compile-time errors.
We switched from @removed back to @deprecated to avoid these
problems. In order to effectively deprecate these methods, which
are error-prone and insecure, make them throw
UnsupportedOperationException if the app's target SDK is M or
above.
Because there are still one or two places in system code that use
these APIs, exempt Process.SYSTEM_UID and the OMA-DM client from
the check for now.
Bug: 22728205
Change-Id: I790bd32f3aa8067cbb625962a209bb9232f4b58c