Commit Graph

9451 Commits

Author SHA1 Message Date
TreeHugger Robot
781e50a49b Merge "Migrate from config.xml to SystemConfig for disabled carrier apps" into pi-dev 2018-03-27 21:48:06 +00:00
TreeHugger Robot
dda147e179 Merge "Fix statsd logging in BatteryStats (nesting prob.)" into pi-dev 2018-03-27 21:45:46 +00:00
Mike Ma
926a97cd3f Track USB data link in batterystats
Record USB data link state in addition to plug & charging state, since
modern USB controller can keep USB data link connected with minimum
current. Device is not acutally charging at those times.
Test: manual
Fixes: 76209292

Change-Id: I0710d547399a631d594488a524682ccc32a25ce6
2018-03-27 12:05:48 -07:00
Bookatz
235343daec Fix statsd logging in BatteryStats (nesting prob.)
Several statsd atoms are not logged correctly from batterystats, due to
possible nesting issues (batterystats only reports a single stop at the
end, whereas statsd expects each stop, resulting in statsd thinking that
the event is still continuing). This cl fixes those.

Bug: 69478888
Test: current ones still pass
Change-Id: I3ae8d7cc3d2eec7d4ab2721c83d208384adbf690
2018-03-27 09:32:18 -07:00
TreeHugger Robot
c6d9f7ce1d Merge "More flexible API enforcement policy." into pi-dev 2018-03-27 10:34:38 +00:00
Mathew Inwood
e3299533b5 More flexible API enforcement policy.
This CL adds the basics to set black, dark gray or light gray list
enforcement, rather than just black as before. It's not possible to
actually set the policy per-package yet.

PackageDexOptimizer still uses a single bit, for API checks on/off, rather
than the new enum. It assumes blacklist enforcement internally. This can
be improved in a follow up CL.

(cherry-picked from commit e52130ae4c)

Test: m
Test: Boot device

BUG: 73337509
Change-Id: Ieb4bd9cc439c6a5b8fb9424d8902d8b46aec309f
Merged-In: Idd73c9938592c5c4d67cfb9efefdffed0dd5f262
2018-03-27 09:28:33 +01:00
TreeHugger Robot
9a6bc76ee8 Merge "API council requested tweaks to TrafficStats." into pi-dev 2018-03-27 02:56:24 +00:00
Jerry Zhang
df101a4596 Merge "Write descriptors for Mtp in UsbService" into pi-dev 2018-03-27 02:49:02 +00:00
Jeff Sharkey
121d565b65 API council requested tweaks to TrafficStats.
Test: atest android.appsecurity.cts.AppSecurityTests#testAppFailAccessPrivateData
Bug: 71584606
Change-Id: I4be8a47d54a04f17cbaac735d543ff7d6370376d
2018-03-26 13:12:39 -06:00
Dmitry Dementyev
4da14e00fc Remove unimplemented RecoverableKeystoreManager APIs.
Add some Nullable annotations.

Bug: 75952916,74859770
Test: apct
Change-Id: I25710263a1ba806d49ec11638dab00f3513631a8
2018-03-23 16:30:51 -07:00
David Srbecky
6ae5d863de Merge "Fix mini-debug-info generation for apps with wrap.sh script." into pi-dev 2018-03-23 13:27:21 +00:00
David Srbecky
b7df58c81f Fix mini-debug-info generation for apps with wrap.sh script.
Debuggable apps enable mini-debug-info after fork, however, this does not
work with apps with wrap.sh script since they follow different code path.

Enable mini-debug-info generation for those as well.

Bug: 74070426
Test: check that app with wrap.sh generates debug info for JIT now

(cherry picked from commit 28a89370f0)

Merged-In: I489ac3c82bcced8fc0448ed5666f67009cbb043d
Change-Id: I22db2e889e918eb4b64c722289f7c046bb499d1d
2018-03-23 10:53:24 +00:00
Aseem Kumar
933dfc1cd6 Delete unimplemented APIs from RecoveryController.
Bug: 74859770
Test: make update-api builds
Change-Id: Ic547e0ee2ef13995389a71369ffa736a7d83b78a
2018-03-23 05:16:42 +00:00
TreeHugger Robot
51856fde2b Merge "Updated the styling for notifications" into pi-dev 2018-03-23 00:02:35 +00:00
TreeHugger Robot
827a06d4b4 Merge "Record Bluetooth Cumulative Stats Properly" into pi-dev 2018-03-22 21:39:03 +00:00
Jerry Zhang
6d319b8aaa Write descriptors for Mtp in UsbService
The current model for setting up a functionfs
function is:

UsbDeviceManager#setCurrentFunctions() ->
intent is sent to MtpReceiver to write the descriptors ->
init/hal waits for descriptors to write, then pulls up gadget ->
Gadget is configured, a USB_STATE intent starts MtpServer

The main downside of this is a lack of reliability because
the Mtp process could be killed at any point. Normally, a
gadget is unbound if its control endpoint is closed. no_disconnect
works around this, but is still a little janky. In addition, the
extra intent delays the startup of the gadget.

With the new model, UsbDeviceManager writes the descriptors
on initialization. Since it is a system service, it won't be killed.

UsbDeviceManager#setCurrentFunctions() ->
init/hal pulls up gadget ->
Gadget is configured, a USB_STATE intent starts MtpServer
MtpServer calls UsbManager#getControlFd to get a dup of the control
endpoint.

Also modify permissions so system server can access mtp files.

Bug: 72877174
Test: Change usb configurations to ptp/mtp
Change-Id: Id17d2b5930f4e1f37ec1b4f00add9d594174ad49
2018-03-22 11:35:19 -07:00
Makoto Onuki
c7f6eadffc Merge "Move provider access stats to frameworks/base" into pi-dev 2018-03-22 17:42:13 +00:00
Makoto Onuki
d0b64e6902 Move provider access stats to frameworks/base
Bug: 76037330
Test: boot and dumpsys activity provider ContactsProvider2
Change-Id: I69cfe0edc98da00d1212f57871646488f87eb8dd
2018-03-22 07:53:57 -07:00
TreeHugger Robot
245f8e5ab5 Merge "Make sure at least one non-aux IME is enabled" into pi-dev 2018-03-22 03:08:38 +00:00
TreeHugger Robot
dcccfd9742 Merge "ScheduledJobStateChanged: add stop reason" into pi-dev 2018-03-22 01:30:52 +00:00
Selim Cinek
c7f5a827d6 Updated the styling for notifications
The new notifications now have different font weights
and colors to make the shade more readable.

Fixes: 69168591
Test: runtest systemui
Change-Id: I0b635724fa122d292841e56efa84aa57fa364300
2018-03-21 17:03:38 -07:00
Fyodor Kupolov
163a57d71e Merge "Added BinderCallsStatsService" into pi-dev 2018-03-21 23:02:58 +00:00
Mike Ma
561a8d9d60 Record Bluetooth Cumulative Stats Properly
updateBluetoothStateLocked does not check for null values, causing
NPE. This patch reverts part of the change in 3445570. Instead, an
update method is added to LongSamplingCounter, which accepts
cumulative values.
Fixes: 75963520
Test: LongSamplingCounterTest

Change-Id: I89eba8e20f8f055c60f4ff250653345a22536189
2018-03-21 13:09:28 -07:00
TreeHugger Robot
b24d84b222 Merge "Category message is sufficient for message notif" into pi-dev 2018-03-21 17:43:40 +00:00
TreeHugger Robot
655877cd84 Merge "Restore state if password change fails" into pi-dev 2018-03-21 15:41:34 +00:00
Beverly
eb455965ef Category message is sufficient for message notif
If a notification is marked with category message, then
it is sufficient enough to be deemed a "message" notification.
However, to be considered an important message, we still
check if the message is from the default messaging app and has
category = message.

Change-Id: I4f2b502634b805919bdf8b82e3bdf475c0992bdd
Fixes:76019310
Test: AttentionManagementVerifierActivity
Test: atest services/tests/uiservicestests/src/com/android/server/notification/NotificationComparatorTest.java
2018-03-21 10:46:33 -04:00
Robert Berry
889e78cb28 Merge "Add RecoverySession importKeyChainSnapshot method" into pi-dev 2018-03-21 12:25:37 +00:00
Rubin Xu
682d167580 Restore state if password change fails
Bug: 73299306
Fixes: 73299306
Test: Call LockPatternUtils.clearLock() with wrong password,
      make sure device still unlocks after reboot
Change-Id: I640fc62cbe0c0c57e980455d4f499df02dee0832
2018-03-21 12:05:04 +00:00
Robert Berry
4a5c87def0 Add RecoverySession importKeyChainSnapshot method
This imports the keys directly into the keystore of LockSettingsService,
allowing them to be accessed via the RecoveryController getKey method.
This is better as it does not expose raw key material to any app.

Bug: 74345822
Test: runtest frameworks-services -p \
      com.android.server.locksettings.recoverablekeystore

Change-Id: I4991b0cff1d2fa2e5bd0b53a71c096499e93e98b
2018-03-21 10:24:41 +00:00
Yohei Yukawa
9c372194f8 Make sure at least one non-aux IME is enabled
Imagine the scenario where three IMEs are installed, and only the last
two are enabled:

 IME A:
  * a pre-installed IME
  * has a subtype [mode="keyboard" && isAuxiliary=false]
  * disabled by user (hence not included in ENABLED_INPUT_METHODS)
 IME B:
  * a pre-installed IME
  * has a subtype [isAuxiliary=true]
  * currently enabled (included in ENABLED_INPUT_METHODS)
 IME X:
  * not a pre-installed IME
  * has a subtype [mode="keyboard" && isAuxiliary=false]
  * currently enabled (included in ENABLED_INPUT_METHODS)

In this scenario, when the IME X is uninstalled, the current
implementation of InputMethodManagerService (IMMS) does not try to
hard reset enabled IMEs because there is still one enabled IME, even
though it is an auxiliary IME.

This can, however, be problematic because an auxiliary IME is just a
supplemental IME and user may not be able to easily access the UI to
re-enable non-auxiliary IME such as IME A.  For instance, on the lock
screen there is no way to manually re-enable the IME A.

With this CL, every time the available IME list is updated, IMMS
ensures that at least one non-auxiliary IME is enabled.  If no
non-auxiliary IME is enabled, then IMMS tries to pick up one from the
pre-installed IME by using the same logic when choosing the default
enabled IMEs for the hard-reset scenario.

Bug: 71509065
Fix: 71509065
Test: atest FrameworksCoreTests:com.android.internal.inputmethod.InputMethodUtilsTest
Test: Manually verified in the above scenario
Change-Id: I88c69f548526b35f0e4ba37489365b2433373b04
2018-03-20 22:54:56 -07:00
Bo Zhu
b31ab6740d Use the new root cert file under the core/ folder
This CL also adds an alias param to the RecoverySession#start method.

Bug: 76033708
Test: runtest frameworks-services -p \
      com.android.server.locksettings.recoverablekeystore

Change-Id: I870f4f89bd6e319e1687a981aa04af0d23f3c922
2018-03-20 22:49:00 -07:00
TreeHugger Robot
6ed6340e3c Merge changes from topic "SoundTriggerJobService-steps" into pi-dev
* changes:
  Throttle number of sound trigger operations / day
  Add SoundTriggerDetectionService
  Expose SoundTriggerManager and SoundTrigger APIs
2018-03-21 03:27:56 +00:00
Philip P. Moltmann
18e3eb8168 Add SoundTriggerDetectionService
The service is meant to replace the PendingIntent based API. Once all
users of the PendingIntent based API switched the PendingIntent based API
will be removed.

To have as little as possible impact on the whole SoundTrigger framework
the RemoteSoundTriggerDetectionService class implements the same
interface as the PendingIntent based class. Hence the exising code has
very little change. Further once the old code can be removed the amount
of changed (and added) code is limited.

The RemoteSoundTriggerDetectionService -> SoundTriggerDetectionService
is a vanilla as possible service implementation. The special behaviors
are:
- The system holds a wakelock while service operations are in progress
and the service is bound as foreground. Hence the service can e.g.
listen to the microphone.
- Service operations have a certain amount of time they are allowed to
run. Once every operation is either finished or the the operation
exceeded the allotted time, the system calls onStopOperation for each
still pending operation. This is a similar model as for the commonly
used JobService.
  Please note that if the time allowed for an operation is 15s and
op1 was run as 0si, and op1 was run at 5s, the service is allowed to run
until 20s. Hence _both_ onStopOperations will happen at 20s. This is
done for ease of implementation but should not give the service more
power than calling onStopOperation exactly 15s after each operation is
triggered.
- If an operation is done before the allotted time is reached, the
service can declare the operation as finished manually by calling
onOperationFinished. This is a call back into the system, hence a
'client' binder is sent to the service. If the operation is finished
by calling this method onStopOperation will not be called.
- As the service instance might be killed and restored between
operations we add a opaque bundle 'params' to each operations. The users
of the API can use this to send data from the start command to the
operations. It can also just be set to null. The params are not meant to
store changing state in between operations. Such state needs to be
persisted using the regular methods (e.g. write it to disk)
- A service can be used for multiple recognition sessions. Each
recognition is uniquelity defined by its sound model UUID. Hence each
operation gets at least tree arguments: Operation ID, sound mode UUID, params
- As a small optimization the params are cached inside of the service
instance.

The time allowed for each operation is in a @SystemAPI global setting,
so the service can make sure it finishes the operations before they are
stopped. It might take some time to deliver the operations via the
binder, hence it is not recommended to try to use every last ms of
allotted time.

Test: atest SoundTriggerDetectionServiceTest (added in separate CL)
      atest android.provider.SettingsBackupTest
Change-Id: I47f813b7a5138a6f24732197813a605d29f85a93
Fixes: 73829108
2018-03-20 13:57:14 -07:00
Eugene Susla
7b24b2bc3e [DO NOT MERGE] Make TCMS multi-user-aware
Bug: 74392619
Fixes: 72481438
Test: presubmit
Change-Id: I1a04fe59216ac94ade8db0c2f56b83ca648db1e7
(cherry picked from commit 835c8b3962)
2018-03-20 19:40:03 +00:00
Tej Singh
33a412b52d ScheduledJobStateChanged: add stop reason
Adds stop reason to scheduled job state changed

Bug: b/71755130
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.UidAtomTests#testScheduledJobState
Test: cts-tradefed run cts-dev -m CtsIncidentHostTestCases -t com.android.server.cts.JobSchedulerIncidentTest
Change-Id: Ic29a5e9160ac258140a52d31bc6210300949545d
2018-03-20 11:20:58 -07:00
TreeHugger Robot
374b86a743 Merge "Update system notification channels" into pi-dev 2018-03-20 13:13:36 +00:00
TreeHugger Robot
dba47fcd09 Merge "Atoms: Mobile Connection" into pi-dev 2018-03-19 20:45:55 +00:00
Tracy Zhou
017f44be88 Merge "Move default pip position to right above the shelf." into pi-dev 2018-03-19 20:15:14 +00:00
TreeHugger Robot
1639c330fc Merge "Resolve STATSD and batterystats race condition" into pi-dev 2018-03-19 18:00:40 +00:00
Tracy Zhou
43513086d2 Move default pip position to right above the shelf.
This change takes care of the flow from WindowManagerService to
PinnedStackController, all the way to PipTouchHandler. It also
introduces a WindowManager hook that allows Launcher to pass in
shelf visibility and height. A separate change is made to send
signals from Launcher to SysUI. (ag/3724896)

Bug: 73961893
Change-Id: I2ff54e78bc2dc35c806b902464048b051a4d6394
Test: atest CtsActivityManagerDeviceTestCases:ActivityManagerPinnedStackTests
2018-03-19 17:41:08 +00:00
Tej Singh
eee317b7b6 Atoms: Mobile Connection
Atom definitions for MobileConnectionStateChanged and
MobileRadioTechnologyChanged

Also cleans up batterystats.

Bug: b/72320589
Test: verified logs appear in adb logcat -b stats
Change-Id: I9feb258cf6dd4a8c8bf1cffc9566b5d0a851a9fa
2018-03-19 09:48:22 -07:00
Julia Reynolds
fd80cff8e8 Update system notification channels
Allow some channels to be blocked, and most to
bypass DND.

Test: make
Change-Id: I135ef6f32a15bb2fc9c859ab087b2dc7477d67e1
Fixes: 75429403
2018-03-19 12:34:08 -04:00
Mike Ma
234d1828ca Resolve STATSD and batterystats race condition
Both STATSD and batterystats need to read uid cpu info. However, uid cpu
stats needs to be cleared from time to time to conserve memory. To
resolve this race condition, only batterystats will remove uid stats,
both from readers and from the kernel, also with a delay, so that STATSD
can access such info before it is removed.

Refactored readers to reuse some common code. Also removed string reader
from KernelUidCpuFreqTimeReader completely since binary reader has been
working fine for a while.

Change-Id: I209bdcec642e1a29a44b566ce98ebbfaaacb4e6a
Fixes: 72172569
Test: BatteryStatsCpuTimesTest
Test: KernelUidCpuActiveTimeReaderTest
Test: KernelUidCpuClusterTimeReaderTest
Test: KernelUidCpuFreqTimeReaderTest
2018-03-16 17:19:15 -07:00
Chad Brubaker
36b0b60e40 Merge "Hide notifications when in Lockdown mode" into pi-dev 2018-03-17 00:16:34 +00:00
Fyodor Kupolov
ca34851ead Added BinderCallsStatsService
It tracks binder calls into the system server and reports
statistics about CPU time spent per call on multiple dimensions,
e.g. uid or call description.

Usage: dumpsys binder_calls_stats
Overhead: ~0.5% per binder call (if enabled)

Test: manual
Bug: 75318418
Change-Id: I13b854f67f8fd1c9f985b8e45f74dcba2e73b9cb
2018-03-16 23:17:03 +00:00
TreeHugger Robot
ebc30594e0 Merge "Change FUSE_MAX_WRITE's value to 128KB" into pi-dev 2018-03-16 03:00:44 +00:00
Chad Brubaker
ea8c5ef2b8 Hide notifications when in Lockdown mode
When the user triggers lockdown the device is put into a secure state,
beyond disabling less secure unlock modalities this should also disable
notifications so that data is not leaked despite the device being
strongly locked.

Fixes: 74564088
Test: Entered lockdown, verified notifications are no longer displayed
on the lockscreen

Change-Id: I4188c36b11a1b0cd496b8032bd246f0413c911c5
2018-03-15 16:37:43 -07:00
Ryo Hashimoto
5c14d498ff Change FUSE_MAX_WRITE's value to 128KB
In the kernel code, there is a constant FUSE_MAX_PAGES_PER_REQ which
limits the size of requests to 128KB.

Bug: 74725300
Test: atest android.os.storage.cts.StorageManagerTest
Change-Id: I6776a409ea68da946bb58e1a933f51c68cb1a99a
2018-03-15 14:20:49 +09:00
Julia Reynolds
0b8455d4d8 Change DND upgrade noti text and channel
Test: manual
Bug: 74075050
Change-Id: Iaf63b4e8691ba42ac4d1ddccf8f2368bfc0b74d7
2018-03-14 11:40:12 -04:00
Annie Meng
d3b6e9fe22 Merge "DO NOT MERGE Create a key value settings observer for backup parameters" into pi-dev 2018-03-14 13:40:46 +00:00