Commit Graph

8790 Commits

Author SHA1 Message Date
Dan Sandler
afa8043cf5 Merge "Merge "Don't crash onServiceDisconnected..." into oc-mr1-dev am: dab9eff899" into oc-mr1-dev-plus-aosp
am: bb268b9fd6

Change-Id: Iec740e8d40db93eda07e548e097a8cb7b0c4e3b0
2017-10-02 18:23:32 +00:00
Dan Sandler
fce1eb3ea3 Merge "Don't crash onServiceDisconnected..." into oc-mr1-dev
am: dab9eff899

Change-Id: Idfc6a98804928a177153492010e04ec75fa30755
2017-10-02 18:00:56 +00:00
TreeHugger Robot
dab9eff899 Merge "Don't crash onServiceDisconnected..." into oc-mr1-dev 2017-10-02 17:44:57 +00:00
Jeff Sharkey
f8bb2445ff Finish removing ASEC.
Awhile back we explicitly blocked any new ASEC installs, with the
expectation that we'd eventually remove the logic entirely.  We've
had them disabled for about a week now without incident, so let's
rip out the remaining code.

Test: bit FrameworksCoreTests:android.content.pm.PackageHelperTests
Test: bit FrameworksCoreTests:android.content.pm.PackageManagerTests
Bug: 32913676
Change-Id: I1ecc35487420731f5c4bdf03bca5751548ce51b3
2017-09-28 11:32:57 -06:00
Beverly
68c04c024d Merge "Adjusted chooser padding so 2nd line isn't cutoff." into oc-mr1-dev am: 5802026595
am: 3836cce06d

Change-Id: Ia03d3752e15bc7700abecc2dff0d0c1b8a6acdd9
2017-09-26 23:31:06 +00:00
Beverly
3836cce06d Merge "Adjusted chooser padding so 2nd line isn't cutoff." into oc-mr1-dev
am: 5802026595

Change-Id: Ic2bb95c7230ea25646824f41d219b09d3cb70709
2017-09-26 23:20:09 +00:00
TreeHugger Robot
5802026595 Merge "Adjusted chooser padding so 2nd line isn't cutoff." into oc-mr1-dev 2017-09-26 23:14:08 +00:00
Hugo Benichi
d7a9617ea7 Merge changes Ia47e566b,Ib94d79a9 am: b9e2ddfc10 am: a2161c5ccb am: b91bd88c5e
am: f43db3bf94

Change-Id: I4226f31aaea21a7ad2bff7ac8b0a85acc5151cfc
2017-09-26 13:30:24 +00:00
Hugo Benichi
f43db3bf94 Merge changes Ia47e566b,Ib94d79a9 am: b9e2ddfc10 am: a2161c5ccb
am: b91bd88c5e

Change-Id: Ied2b31c9d1219b8aebf5fec085ab598b77bede6e
2017-09-26 13:05:41 +00:00
Hugo Benichi
a2161c5ccb Merge changes Ia47e566b,Ib94d79a9
am: b9e2ddfc10

Change-Id: I0cac456f778db78d76d2225b79ce42526a6d2d19
2017-09-26 11:46:30 +00:00
Hugo Benichi
67c5e03b54 Extract RingBuffer class from NetdEventListenerService
This patch takes out the ring buffer array added for NFLOG wakeup packet
events logging and extract it into its own class for reuse. This new
RingBuffer class has the two minimal useful functions append() and
toArray().

Bug: 65164242
Bug: 65700460
Test: runtest frameworks-net, with new unit test
Change-Id: Ib94d79a93f4e99661b7d0fac67117b91d57af980
2017-09-26 14:14:16 +09:00
Dan Sandler
fcd7fae5e6 Don't crash onServiceDisconnected...
...if destroy() hasn't already been called through some
other codepath.

Bug: 65249720
Test: runtest -x core/tests/coretests/src/com/android/internal/app/ChooserActivityTest.java
Change-Id: I5f90548e437986d8585390578f4ceecd57cc3473
2017-09-25 17:43:16 -04:00
Sudheer Shanka
f39df68b71 Merge "Add shutdown reason as extra when triggering ACTION_REQUEST_SHUTDOWN." 2017-09-25 20:42:52 +00:00
Adrian Roos
f2ebc40286 Merge "FRP: Add config flag for disabling credential FRP" into oc-mr1-dev am: 73c93f02f7
am: 392a9b5c1d

Change-Id: Ifeb044d767b03c799fa028e6efc967b88fae7b53
2017-09-25 18:47:59 +00:00
Adrian Roos
392a9b5c1d Merge "FRP: Add config flag for disabling credential FRP" into oc-mr1-dev
am: 73c93f02f7

Change-Id: I647bfc52892b305eb59f446812e142b609172bd4
2017-09-25 18:38:23 +00:00
Sudheer Shanka
292637f51a Add shutdown reason as extra when triggering ACTION_REQUEST_SHUTDOWN.
When BatteryService triggers ACTION_REQUEST_SHUTDOWN intent, add the reason
for shutdown as extra to indicate low battery or critical battery
thermal state.

Bug: 63736262
Test: 1/ adb shell cmd battery unplug && adb shell cmd battery set level 0
      2/ Power on the device
      3/ Verify sys.boot.reason == shutdown,battery
Test: 1/ adb shell cmd battery set temp 700
      2/ Power on the device
      3/ Verify sys.boot.reason == shutdown,thermal,battery

Change-Id: If20a36ef53f8bcbfae4114df08f741ec1dcd7df9
2017-09-25 11:20:37 -07:00
Adrian Roos
2adc263ce9 FRP: Add config flag for disabling credential FRP
Bug: 65258606
Test: Verify FRP still works when not disabled
Change-Id: I78e308b6eaba73c794615b1eebdbfacb334ae72f
2017-09-25 13:32:48 +02:00
Beverly
3aee178c86 Adjusted chooser padding so 2nd line isn't cutoff.
Change-Id: I171eafed073b4412904e3c0dc6f88efb8370d3bf
Fixes: 65546796
Test: manual
2017-09-21 17:14:04 -04:00
Christine Franks
0321346f38 Handle night display state when timezone changes
Bug: 64458884
Test: runtest -c com.android.server.NightDisplayServiceTest \
frameworks-services and manually tested Hawaii and London

Change-Id: I052034a4c64eb73c42672215e8847c11e00efeb5
(cherry picked from commit 2ce862c3ed)
2017-09-20 03:35:49 +00:00
Christine Franks
1cdb151ef7 Merge "Handle night display state when timezone changes" into oc-mr1-dev
am: 1276f357d3

Change-Id: I96cc0161eb092f2a965efbff4a417bc992493625
2017-09-20 00:43:12 +00:00
Christine Franks
1276f357d3 Merge "Handle night display state when timezone changes" into oc-mr1-dev 2017-09-20 00:23:28 +00:00
Christine Franks
2ce862c3ed Handle night display state when timezone changes
Bug: 64458884
Test: runtest -c com.android.server.NightDisplayServiceTest \
frameworks-services and manually tested Hawaii and London

Change-Id: I052034a4c64eb73c42672215e8847c11e00efeb5
2017-09-19 14:37:26 -07:00
Nicolas Geoffray
46a0cf5a2b Merge "Special handling of priv-apps in Zygote." am: 46af70cad9 am: 79d4ef6caa am: 836f2fe701
am: 0bd07225e7

Change-Id: I21e4726a7e76a4d595cd819d64b2fcc1aa2dfd6d
2017-09-19 12:19:26 +00:00
Nicolas Geoffray
0bd07225e7 Merge "Special handling of priv-apps in Zygote." am: 46af70cad9 am: 79d4ef6caa
am: 836f2fe701

Change-Id: Ieb8b53e69ac14be6e4e0e0210f12343e7e863b66
2017-09-19 12:11:51 +00:00
Nicolas Geoffray
79d4ef6caa Merge "Special handling of priv-apps in Zygote."
am: 46af70cad9

Change-Id: I1dbf2313c9ee1c014854630eac5f1429548ae7f6
2017-09-19 11:56:05 +00:00
Nicolas Geoffray
46af70cad9 Merge "Special handling of priv-apps in Zygote." 2017-09-19 11:47:58 +00:00
Adam Bookatz
b0cfa7649f Merge "Merge "Throttle fetching RPM stats" into oc-mr1-dev am: 8ddb77a3df" into oc-mr1-dev-plus-aosp
am: 1fceacc297

Change-Id: Ib95911358e18867e6e238009f0f4b4b9d01e631e
2017-09-15 07:17:17 +00:00
Adam Bookatz
c69e138213 Merge changes I54d54f24,I0c384eb3 into oc-mr1-dev am: e332629667
am: 065f4b7ea7

Change-Id: I27a13ed75f663e1d1478667cf02aa8f754201326
2017-09-15 07:09:27 +00:00
Jiyong Park
b16d32bc78 Merge "vendor apk is unbundled" into oc-mr1-dev am: a26750e757
am: 6cc659cd9e

Change-Id: If89b2e232e78b78e2b33dd2d529e2718903b8c22
2017-09-15 00:13:49 +00:00
Narayan Kamath
66d7275d39 Merge changes Id931d441,I83faf974
am: 89c94f67b4

Change-Id: Ifc090e141092bcee11704e45d6f97f642040d002
2017-09-14 23:57:14 +00:00
Andreas Gampe
14e3e529f8 Merge "resolve merge conflicts of eb8a4ef5d3 to oc-mr1-dev-plus-aosp" into oc-mr1-dev-plus-aosp
am: b840785100

Change-Id: I5547c135edda0ba51869c7131d83dd221aa7d740
2017-09-14 22:46:53 +00:00
Svet Ganov
087dce20e3 Add new OEM permission flavor
The new OEM permission flavor of signature protected perissions
can be granted only to apps on the OEM partition if they are:

 1. Signed as the one declaring the permission

 2. The requesting app is on OEM partition of the system image and
    declares the permission used and the OEM explicitly granted this
    permission by adding an entry in /oem/permission/*.xml
    with the following format:

    <permissions>
        <oem-permissions package="foo.bar.baz">
            <permission name="android.permission.ACCESS_FOO" granted="true"/>
        </oem-permissions>
    </permissions>

All OEM permissions requested by any app on the OEM partition
must be declared granted or not to force the OEM making a well
though out explicit choice. If that condidtion is not met the
system server restarts - this prevents shipping a device with
OEM permissions for which no opition was explicitly expressed.

Normal apps requesting an OEM permission has no effect, i.e the
permission is only granted on a signature match.

Change-Id: I345bb0b56368ee03e4bd768faab540ee4e0571ae
Bug: 65497745
Test: Manual
2017-09-14 11:48:45 -07:00
Adam Bookatz
024a096e22 Merge "Throttle fetching RPM stats" into oc-mr1-dev
am: 8ddb77a3df

Change-Id: I97868b6f4327125f201384e0d6dc1a597ddfa6d9
2017-09-14 18:39:35 +00:00
Adam Bookatz
065f4b7ea7 Merge changes I54d54f24,I0c384eb3 into oc-mr1-dev
am: e332629667

Change-Id: Ib522e060c7a77b0e0ae0ecf3c9d84c331890d3e9
2017-09-14 18:33:47 +00:00
Adam Bookatz
8ddb77a3df Merge "Throttle fetching RPM stats" into oc-mr1-dev 2017-09-14 18:23:36 +00:00
Adam Bookatz
e332629667 Merge changes I54d54f24,I0c384eb3 into oc-mr1-dev
* changes:
  Disable screen-off RPM timing in BatteryStats
  Added resource power manager stats to batterystats
2017-09-14 18:22:34 +00:00
Jiyong Park
6cc659cd9e Merge "vendor apk is unbundled" into oc-mr1-dev
am: a26750e757

Change-Id: I218a52a0fff924ca139c96c35df5b3ad0c917216
2017-09-14 14:51:57 +00:00
Andreas Gampe
8f4eab2fcc resolve merge conflicts of eb8a4ef5d3 to oc-mr1-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ia29e31d704982985264b40a78578a4c93d11bf3a
2017-09-13 19:20:34 -07:00
Narayan Kamath
ac0b4be198 Zygote: Improve logging and error handling during connections.
Before this change, we were throwing a checked exception on success
and returning on failure. This made it hard to figure out where / when
something was going wrong. This change switches things around to throw
a RuntimeException when something goes wrong and to return a Runnable
on success. This lets us make stronger assertions in both the parent
and the child process about their state and expected return values.

This change also upgrades the severity of several errors that we would
earlier just ignore. We will now reject the command and terminate the
connection to the client when we encounter these errors such as:

- Malformed arguments
- Any ZygoteSecurityException, such as thown thrown by
  applyUidSecurityPolicy and applyInvokeWithSecurityPolicy.
- Any error in setting up pipes etc. to facilitate communication
  with child processes.

(cherry picked from commit bf99d06003)

Bug: 13618569
Test: Manual
Merged-In: Id931d44135ae2e4ede1bbac6a4b187f6c139e1fd
Change-Id: Id931d44135ae2e4ede1bbac6a4b187f6c139e1fd
2017-09-13 18:40:59 -07:00
Narayan Kamath
a3d4230b92 Zygote: Fix race condition on package preloads.
Before this change, ZygoteProcess.preloadPackageForAbi returned
as soon as the command was written to the zygote socket and not
after the preload completed. This meant that there was a small
window of time before the server side of the socket polled its FDs
where a second command could be written to the zygote socket. This
would lead to only one of the commands being processed and the
other being dropped. The client side of that socket would then wait
forever for a response and bring down the system once the watchdog
timeout was hit.

Example failure case :
--------------
system_server:send command(preloadPackage)
system_server:send command(fork)
zygote:poll & process command(preloadPackage)  // the fork command is dropped.

Example of normal operation :
------------------
system_server:send command(preloadPackage)
zygote:poll & process command(preloadPackage)
system_server:send command(fork)
zygote:poll & process command(fork)

This change makes preloadPackageForAbi synchronous, which ensures
that each POLLIN event corresponds to precisely one command.

(cherry picked from commit 24a3306c32)

Bug: 62886909
Bug: 13618569
Test: Manual
Contributed-By: yuqianyu@huawei.com

Merged-In: I83faf974c9a70a6ab18323f692c1981784e4c56a
Change-Id: I83faf974c9a70a6ab18323f692c1981784e4c56a
2017-09-13 18:37:05 -07:00
TreeHugger Robot
a26750e757 Merge "vendor apk is unbundled" into oc-mr1-dev 2017-09-14 01:35:42 +00:00
Bookatz
82b34117ee Disable screen-off RPM timing in BatteryStats
RPM = resource power manager.
Fetching the rpm stats (specifically, the subsystem low power stats) is
slow... too slow to reasonably do each time the screen state changes.
Therefore, it is disabled until fetching this information can be done
more quickly. Consequently, the screen-off RPM values will be incorrect
until it is re-enabled; they are therefore not printed.

Bug: 65164435
Bug: 62549421
Test: manual
Change-Id: I54d54f244c69ee372f22ecd99f32570db4aeb222
2017-09-13 22:24:25 +00:00
Bookatz
0b8a050853 Throttle fetching RPM stats
RPM stats are expensive to fetch. However, updateRpmStatsLocked can
get called over and over again. E.g. if
BatteryStatsService.getStatistics is called multiple times in quick
succession, the RPM stats would be fetched repeatedly. Because it is
expensive, if therefore makes sense to throttle it to ensure that the
fetching is not done too frequently.

The data last fetched is cached. When asked to update, it will only
actually do so if it is sufficiently old.

Bug: 62549421
Bug: 65629008
Test: manual
Change-Id: I6b7530d203deb9ad5bfb3415336a0de6a55bd89b
2017-09-13 14:31:14 -07:00
Bookatz
50df711a51 Added resource power manager stats to batterystats
Currently Resource Power Management (e.g. VMIN time) is reported in the
batterystats history each time the battery level changes. We need this
information in the batterystats checkin, and need to be able to
differentiate time spent in each power state/voter, total as well as
when the screen is off.
The RPM information is obtained via a JNI call to the appropriate HALs.

Batterystats report version is increased to 26.

Bug: 62549421
Test: manual
Change-Id: I0c384eb3950714d8a0aa1353a4bf965330ebc8c1
2017-09-13 10:54:54 -07:00
Nicolas Geoffray
1f88ad66e1 Special handling of priv-apps in Zygote.
If pm.dexopt.priv-apps is set to false, disable verifier and
only allow loading oat files from system.

bug: 30972906
bug: 63920015

Test: works as expected when pm.dexopt.priv-apps is true or false
Change-Id: Ib9e80c9b7b4106e82c0b9d1c7fbb8065c190ac1f
2017-09-13 14:21:00 +01:00
Nicolas Geoffray
1bf40f63b3 Missed these renames in last commit.
Test: builds
Change-Id: I6c2d03accc55aef8381f38f9b182f2367e25a915
2017-09-13 12:59:21 +01:00
Nicolas Geoffray
8dbb5e51c8 resolve merge conflicts of e017dae587 to stage-aosp-master
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I7008986501028ec9bee0505d41aae3ff27872b50
2017-09-13 11:08:36 +01:00
Nicolas Geoffray
81edac4037 Rename debugFlags to runtimeFlags.
Also now pass the flags to the forked process through --runtime-flags instead
of converting to command line arguments and converting back to an integer.

bug: 30972906
bug: 63920015

Test: builds

Change-Id: I7f10c43dd916ca2d3b9b5141f17261eb7b64f49a
2017-09-12 15:54:23 +01:00
Chad Brubaker
e7454950f6 Merge "Expand and expose Lockdown global action" 2017-09-11 22:04:07 +00:00
Jason Monk
77c8295721 Merge "Fix broken window flag" into oc-mr1-dev am: 07d0b93914
am: e9c5d8aad6

Change-Id: Ifb11ae36366fee42a2eed731584351c93d438d7c
2017-09-11 19:28:04 +00:00