27833 Commits

Author SHA1 Message Date
Wale Ogunwale
4270924801 Fixed issue with moveTaskToBack on single stack devices
Icdad980eec64e081d15679600da07cf4431e40d6 allowed us to
properly return to the home acitvity when a task is moved
to back. However, this improperly moved the home task to
the front if it is the task we are moving to the back on
a single stack device. We now prevent the movement of the
home task to the front from happening.

Bug: 23088310
Change-Id: Ic21779cdb2d2007671d212d41fab5e68be2ae632
2015-08-11 13:54:42 -07:00
Alan Viverette
b4eb06402f Merge "Avoid use-after-free race condition when rebasing theme" into mnc-dev 2015-08-11 18:24:04 +00:00
Alan Viverette
c12ec70def Avoid use-after-free race condition when rebasing theme
... by never rebasing the theme. We don't need to do this unless the
system theme is configuration-dependent, which it is not currently.

Bug: 22943781
Change-Id: I96e695441543379e4d5fdf3cc6f18d9e6cf953b4
2015-08-11 10:26:08 -04:00
Lorenzo Colitti
31e19f34f5 Don't attempt to stop the receive thread if we never started it.
If socket initialization fails, DhcpState#exit will call
mReceiveThread#stop and crash the system with an NPE. Make sure
we don't do that if mReceiveThread is null, and properly null it
out when exiting.

Bug: 23088314
Change-Id: I4378d8280f9d8588f5eaa8bd7ade61beab1c3ce2
2015-08-11 15:42:59 +09:00
Matthew Williams
77d5b91401 Merge "DO NOT MERGE: Idle Job Start During SCREEN_ON or DREAMING_STOPPED" into mnc-dev 2015-08-10 22:36:49 +00:00
Kevin Zhu
e910be0b7e DO NOT MERGE: Idle Job Start During SCREEN_ON or DREAMING_STOPPED
BUG: 23086704
Cherry-picked from https://android-review.googlesource.com/#/c/162280/
When the screen goes off or dreaming start, an alarm will be
scheduled and idle state will be true when the alarm expired.
If the screen goes on or dreaming stop happens before
the alarm expired, the alarm isn't cancelled and idle state is
set to be true when the device is in SCREEN_ON or DREADING_STOPPED
state. There is also a case that Idle alarm triggered when
the screen on or dreaming stop just start to be processed.
ACTION_TRIGGER_IDLE will set mIdle to true during screen on
or dreaming stop.

In this patch, the alarm will be cancelled when the screen goes
on or dreaming stop and screen-on flag will be set. So the idle
state can only be set when screen is off or dreaming started.

Change-Id: Ic21a2394418ca55513ab932b3bfad1126b8769c1
2015-08-10 15:03:34 -07:00
Simranjit Kohli
301dfe08bc Merge "[Fix getAccounts MANAGE_USERS permission]" into mnc-dev 2015-08-10 21:36:30 +00:00
Filip Gruszczynski
26ed265cee When closing task stack remove reference to display content.
This tightens the guarantee that detached stack won't be used. We also
add logging to detecting a situation where a stack not belonging to a
display is being moved on that display.

Bug: 22191609
Change-Id: Ia674bb5960018104a56c5138775ab5216906675b
2015-08-10 13:03:46 -07:00
Simranjit Singh Kohli
b77d8b6085 [Fix getAccounts MANAGE_USERS permission]
Make code having potential to call userInfo inside clearIdentity.
Bug: 22917218

Change-Id: If95fb7c0ec36a2f5c737f04bc7d8af95b44fea22
2015-08-10 12:48:09 -07:00
Svetoslav Ganov
90b030bae8 Merge "Do not show removed permissions in the UI - framework" into mnc-dev 2015-08-08 06:48:38 +00:00
Dianne Hackborn
fc81be947f Merge "Fix issue #23037093: "Write system settings" permission value fails..." into mnc-dev 2015-08-08 06:35:03 +00:00
Svet Ganov
3e0be7440b Do not show removed permissions in the UI - framework
bug:23043018

Change-Id: Ia5cf49f299eda627d9fde2b34498812afcb3a6d5
2015-08-07 23:06:04 -07:00
Dianne Hackborn
4d34bb8304 Fix issue #23037093: "Write system settings" permission value fails...
...to persist after reboot

We were writing a corrupt settings file, so would always reset back
to the default app ops state after boot...!

Also add new appops service commands to manually write and read
its settings, since that is very useful for testing.

Change-Id: Ia510507764738fd82e45ec0be6db840c6ea30c28
2015-08-07 18:37:21 -07:00
Billy Lau
70f998e57d Merge "Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS" into mnc-dev 2015-08-07 22:16:03 +00:00
Dianne Hackborn
f0e5501e09 Merge "Fix issue #22989030: Separate battery whitelists" into mnc-dev 2015-08-07 21:58:38 +00:00
Dianne Hackborn
4a503b1ece Fix issue #22989030: Separate battery whitelists
We now have a new whitelist you can put apps in, which
opts them out of the old battery saver mode and new app idle,
but doesn't keep them from going in to doze.  This is for a few
special cases that we had previously whitelisted for battery saver,
and inherited to the new modes...  ultimately we should figure out
how to get these apps out of the whitelist completely, but this
will help for now.

Apps in this new whitelist are not shown in the UI, because they
are still significantly restricted by not being able to operate
normally in doze.  This also means they are still visible in the
list of all apps for the user to be able to put them on/off the
complete whitelist if that is what they really want.

In the course of doing this, I needed to clean up code in the
network policy manager to better separate management of the
two firewall rules that now have different whitelists applied
to them.  This also hopefully just generally simplifies and cleans
up that code.  Hopefully!

Change-Id: I92e15f2f85899571dd8b049b5e3eb1354f55f353
2015-08-07 14:23:32 -07:00
Nicolas Prévot
288e82f8f6 Merge "Keep intent verification status of system apps when uninstalling them." into mnc-dev 2015-08-07 19:23:52 +00:00
Jason Monk
69ed33087d Merge "Allow system to disable lockscreen" into mnc-dev 2015-08-07 18:40:19 +00:00
Billy Lau
a7238a397d Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS
Merge the CHANGE_NETWORK_STATE permission with WRITE_SETTINGS.

AndroidManifest.xml:
Raised the protection level of CHANGE_NETWORK_STATE permission from
normal to signature|appops and pre23|preinstall for compatibility

provider/Settings:
Wrote new helper methods to check if app is allowed to change network
state.

ConnectivityManager.java & ConnectivityService.java:
Replace enforcement checks for CHANGE_NETWORK_STATE with
checkAndNoteChangeNetworkStateOperations instead.

Change-Id: If8c2dd3c76a5324ca43f1d90fa17973216c2bcc5
2015-08-07 19:29:51 +01:00
Amith Yamasani
1fbc1b3b4b Merge "Fix partial user cleanup on restart" into mnc-dev 2015-08-07 18:21:30 +00:00
Nicolas Prevot
b5ab2ffc21 Keep intent verification status of system apps when uninstalling them.
When creating a work profile, system apps are uninstalled and then
sometimes reinstalled.
In the process, they lose their intent verification status.

BUG:22943461
Change-Id:I5b008c6de2125f190063b08908076a649067c60d
2015-08-07 19:13:01 +01:00
Amith Yamasani
a7892486c2 Fix partial user cleanup on restart
Internal volume was not available during PackageManagerService creation,
which resulted in a zombie user's folder not being cleaned after a reboot.

Add the internal volume earlier in the boot cycle so that it can be accessed
for user cleanup.

Bug: 22483086
Change-Id: I8f3ffbb25f3902d00a96d1ee2d7a79373c5e35b7
2015-08-07 11:09:05 -07:00
Dianne Hackborn
3d06ea0349 Merge "Debugging for issue #22556778: Starting under voice control not allowed" into mnc-dev 2015-08-07 18:06:01 +00:00
Dianne Hackborn
74aefdf28f Debugging for issue #22556778: Starting under voice control not allowed
Better error messages in log to explain what is going on.

Change-Id: Ie686a323ceedd42453b6581fe79653b407d49ee5
2015-08-07 10:37:21 -07:00
Svetoslav Ganov
38d30dc547 Merge "Immediately kill a shared user process on a permission revocation." into mnc-dev 2015-08-07 15:27:49 +00:00
Jason Monk
b978ce7f25 Allow system to disable lockscreen
Even when there is a pin.

Bug: 22920549
Change-Id: Ib84e1c3ac67be0318d4186c66ee582a49969e373
2015-08-07 09:21:51 -04:00
Svetoslav
aa41add33b Immediately kill a shared user process on a permission revocation.
1. When a permission is revoked we kill the app immediately but do
   not do an immediate kill for shared uid processes. This fixes it.

2. Remove system APIs that are used only by the package installer.

bug:22984670

Change-Id: I3d4ae52ea8679f894aa7c5972941263903479183
2015-08-06 18:47:41 -07:00
Jeff Davidson
1d7c32548c Merge "Correctly propagate permissions when uninstalling updates." into mnc-dev 2015-08-07 01:39:14 +00:00
Wale Ogunwale
a0ef49c44f Look for recent tasks in live stacks.
It is possible for a tasks not to have been saved to the
persisted recent list yet for various reasons. This causes
some external calls to fail when they are trying to do
an operation on a task with a given id. We now use the
stack supervisor look-up for a task id that checks
everywhere a task might be including live stack. It this
fails then the task truly doesn't exist.

Bug: 22924782
Change-Id: I57c3df41d0b4f3ee3c5ae9b7d01eeb2b352062b4
2015-08-07 00:26:01 +00:00
Andres Morales
85c73c40d1 Merge "[UserManager] expose method to retrieve credential owner" into mnc-dev 2015-08-06 22:22:17 +00:00
Chris Wren
93f3fc8766 Merge "add metrics to assistant" into mnc-dev 2015-08-06 19:18:17 +00:00
Benjamin Franz
339a9bbf6d Merge "Use realActivity as indicator for task locking" into mnc-dev 2015-08-06 19:15:29 +00:00
Chris Wren
a35c96eb90 add metrics to assistant
long press
  screenshot enabled
  context enabled

Bug: 22949579
Change-Id: Iac178207fa7149cda03c9a817a0d1450e46e1c59
2015-08-06 15:11:42 -04:00
Svetoslav Ganov
38c0fbda53 Merge "Pregrant unrevokable storage permission to the CertInstaller" into mnc-dev 2015-08-06 19:08:33 +00:00
Benjamin Franz
6fd84cc878 Use realActivity as indicator for task locking
When lock task mode is started, we verify that the package is
whitelisted and currently use mCallingPackage as indicator. However,
the calling package is not necessarily identical to the package trying
to lock itself, so lock task mode sometimes fails. Switching over to
using realActivity as package marker.

Bug: 22916291
Change-Id: Ifd4df2d634842c8106b0b0f690bcf1faba0ed5fa
2015-08-06 18:09:03 +01:00
Michael Wright
eb7e3d7e45 Merge "Don't dispatch when non-interactive and the display is off." into mnc-dev 2015-08-06 13:50:37 +00:00
Julia Reynolds
a3b5a61271 Merge "Store ringer mode on entering DND mode so it can be restored on exit." into mnc-dev 2015-08-06 13:41:01 +00:00
Svetoslav
0e62952aad Pregrant unrevokable storage permission to the CertInstaller
bug:22988119

Change-Id: I310aa7149f67a7918cecfda13c69ab91c7c6e1a8
2015-08-05 19:14:51 -07:00
Jeff Davidson
16ed6a45ae Correctly propagate permissions when uninstalling updates.
In ag/733689, which was intended to fix this bug, the following lines
were removed:

// Propagate the permissions state as we do want to drop on the floor
// runtime permissions. The update permissions method below will take
// care of removing obsolete permissions and grant install permissions.
ps.getPermissionsState().copyFrom(disabledPs.getPermissionsState());

The intent with these lines seemed to be that we needed to copy
permissions from the application on /data, which is being uninstalled,
over to the copy on /system, which was disabled but is being
reenabled. However, it wasn't functional, because it incorrectly
copied from the copy on /system, not the copy on /data.

Restore this code, copying from newPs (the copy on /data) rather than
disbledPs (the copy on /system), and clarify the comment because we do
*not* want to drop runtime permissions on the floor.

Bug: 22665508
Change-Id: I6bae37e70b6df1043c9a2b49255b985707ba151a
2015-08-05 14:33:17 -07:00
Jim Miller
8ae1be1208 Disable fingerprint when remotely reset by DPM
When the device is lost or stolen, it's safer to
fall back to strong authentication (pin, pattern or
password).  This disables fingerprint like we do with
trust agents.

Fixes bug 21620081

Change-Id: I7bbe54be3721b2f160b783daeb3acbe434705046
2015-08-05 20:06:37 +00:00
Yohei Yukawa
db221acce2 Merge "Reduce log spam for the ease of debugging Bug 22857361." into mnc-dev 2015-08-05 17:59:23 +00:00
Andres Morales
c5548c02fe [UserManager] expose method to retrieve credential owner
Certain operations (like ConfirmCredential) can be invoked
in the context of a profile, in which case the calling code
needs to know under what profile the credential is registered.

Expose a centralized location for this information for Settings
and GateKeeper to consume.

Bug: 22257554
Change-Id: Iffe4f6a254f52d1269b9287edabcf6efa515d9d2
2015-08-05 10:50:05 -07:00
Svetoslav Ganov
e72377e17a Merge "Fix app ops regressions introduced by the per UID policy change" into mnc-dev 2015-08-05 17:22:42 +00:00
Ian Pedowitz
df5a661107 Merge "Revert "Revert "Permissions: GET_ACCOUNTS permission cleanup""" into mnc-dev 2015-08-05 14:34:13 +00:00
Ian Pedowitz
6cc066df7a Revert "Revert "Permissions: GET_ACCOUNTS permission cleanup""
This reverts commit 845d14db9066c3262f270237b52e315aa71508b2.

Bug: 22942480
Bug: 22902898
Change-Id: If2d0e11594284414953c3dd45475fc7ba3366295
2015-08-05 14:25:15 +00:00
Julia Reynolds
9b11fdb56d Store ringer mode on entering DND mode so it can be restored on exit.
Store the value in Settings now, so it's not lost on reboot.
Bug: 22338093

Change-Id: Icc843ef2bf735c23aabf9ceddd82283d51424220
2015-08-05 09:27:23 -04:00
Paul Jensen
dbc4edccfc Merge "Fix NOT_RESTRICTED network capability and enforce it." into mnc-dev 2015-08-05 10:03:47 +00:00
Yohei Yukawa
df5af484f8 Reduce log spam for the ease of debugging Bug 22857361.
Now InputMethodManagerService generates the following log
    Couldn't create dir.: /data/system/inputmethod
not only when it fails to create the directory but also when
/data/system/inputmethod already exists, which makes it
difficult for us to figure out the root cause of boot failure
on emulator environments (Bug 22857361).

With this CL, IMMS no longer shows the message when the
directory already exists.  Basically this is no risk change,
which changes only the condition to show the logging message.

Bug: 22857361
Change-Id: I09aaf501b19845c8309b09b57c23077f1757cd1a
2015-08-04 22:13:28 -07:00
Svetoslav
215b44a1c2 Fix app ops regressions introduced by the per UID policy change
1. Add a missing statement in the parsing code

2. Notify for all packages on UID ap op policy change

bug:22957162

Change-Id: Ic2bd5d07ef52be207e66b63ffe45fd8a456eb5a8
2015-08-04 19:06:41 -07:00
Jae Seo
2094a702b3 Merge "Unregister the existing callback when MediaProjection stops" into mnc-dev 2015-08-05 00:07:11 +00:00