Commit Graph

8918 Commits

Author SHA1 Message Date
Ahmed ElArabawy
f88571ffa1 Proper calculation for overall WiFi MC statistics
In current implementations the WiFi MC statistcs are calculating by
aggregating the per uid statistics accross all UIDs. This does not
result in the correct values in case of time overlapping acquisitions of
MC wakelocks by same or different UIDs
This commit creates a separate Timer instance that tracks the actual
time spent with MC Enabled.

Bug: 69854369
Test: Manual Test

Change-Id: I78533f48300bc9faccc374d684698dae647bde5d
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
2018-01-03 09:06:42 -08:00
Ricky Wai
62bc5f84be Merge "Make Network watchlist use ConfigUpdater to get watchlist" 2018-01-03 14:16:40 +00:00
Narayan Kamath
695cf72f26 Support chained attribution for alarm related WorkSources.
.. those passed down via the AlarmManager.set() variant that takes
a WorkSource. This required a minor re-arrangement of code in
the ActivityManager. We now treat WorkSources as opaque in the
AlarmManager and simply push them down to the AM (and eventually
to BatteryStats) where they are picked apart.

Test: BatteryStatsNoteTest, AlarmManagerTest
Bug: 62390666
Change-Id: I118f1a1d16aafa41b4f401f1a6a3ba4d2d5eca8f
2018-01-03 09:16:56 +00:00
Alan Viverette
f51fa7deac Always allow button stacking
Previously did not allow stacking on small screens, which resulted in
buttons clipping at the ending edge of the dialog.

Change-Id: Iaa36cb657556197018b192c24c4043e6395c74a2
Fixes: 37507002
Test: manual
2018-01-02 16:18:48 -05:00
Yangster-mac
2087716f2b 1/ Support nested message and repeated fields in statsd.
2/ Filter gauge fields by FieldMatcher.
3/ Wire up wakelock attribution chain.
4/ e2e test: wakelock duration metric with aggregated predicate dimensions.
5/ e2e test: count metric with multiple metric condition links for 2 predicates and 1 non-sliced predicate.

Test: statsd unit test passed.

Change-Id: I89db31cb068184a54e0a892fad710966d3127bc9
2018-01-01 10:01:36 -08:00
Eugene Susla
cb37da8b13 Merge "Add a 'unbounded method refs only' clause to PooledLambda javadoc" 2017-12-27 18:17:23 +00:00
Narayan Kamath
bbab9c4e28 Merge "Support WorkChains for WakeLock start / stop / change events." 2017-12-27 08:43:37 +00:00
TreeHugger Robot
550e8ec8fa Merge "Fixed RTL alignment issue in suggested language list" 2017-12-22 19:22:08 +00:00
TreeHugger Robot
14cddc465b Merge "Implement generateAndStoreKey" 2017-12-22 19:10:24 +00:00
susanta.patra
a2c1917e37 Fixed RTL alignment issue in suggested language list
Suggested language list alignment should be as per the default locale.

Test: 1. RTL language
      2. Settings>System>Languages & input>Languages>Add a language>English
      3. Check the alignment
Bug: 70360392

Change-Id: I934b1061fb897ac69270a493562defba4a5a1a35
Signed-off-by: susanta.patra <susanta.patra@lge.com>
2017-12-22 09:41:30 -08:00
Narayan Kamath
8182202ac8 Support WorkChains for WakeLock start / stop / change events.
Log WorkChains associated with a given WorkSource to statsd whenever
a wakelock is acquired / released or changes.

Test: WorkSourceTest, manual.
Bug: 62390666

Change-Id: I1720ba8b1778d38067398caac7cf92c4d375f816
2017-12-22 16:21:07 +00:00
Robert Berry
cfc990a49d Implement generateAndStoreKey
For now just returns raw key material. In the future we will need to
change this to use the KeyStore move api. (Once that has been
implemented.)

Test: adb shell am instrument -w -e package com.android.server.locksettings.recoverablekeystore com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I8aee4da81f0f853503f570dae8d74e1d29f124cc
2017-12-22 15:54:30 +00:00
Ricky Wai
ebe3624628 Make Network watchlist use ConfigUpdater to get watchlist
Bug: 63908748
Test: test_network_watchlist_full.sh samples/network-watchlist-sample.xml

Change-Id: I9dcca568d3f19f2937786c9c184324b43dc08ff2
2017-12-22 11:49:51 +00:00
Robert Berry
bd4c43c686 Update recoverKeys to return raw material
This is a temporary solution, while the KeyStore team works on adding a
move API to KeyStore. (At which point this will be updated to instead
return 'move tokens', allowing the user to move the key from the system's
keystore to their own, without ever seeing the raw material.)

Test: adb shell am instrument -w -e package com.android.server.locksettings.recoverablekeystore com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I2241a6da15d50c26a7b384d4e5b6f78366fb9300
2017-12-22 11:35:14 +00:00
Siddharth Ray
331962242a Merge "Obtain cellular related battery statistics" 2017-12-21 19:53:54 +00:00
Sudheer Shanka
fa4bda70c3 Merge "Update BatteryStatsImpl to track per-procstate cpu times." 2017-12-21 03:51:40 +00:00
TreeHugger Robot
0be794a14c Merge "Add more methods to RecoverableKeyStoreLoader." 2017-12-21 02:01:15 +00:00
TreeHugger Robot
da8d32efbb Merge changes from topic "work_mode_api1"
* changes:
  Add access control to trySetWorkModeEnabled and make it public
  Merge setQuietModeEnabled and trySetQuietModeDisabled into one API
2017-12-21 01:20:28 +00:00
Siddharth Ray
a1fd057c85 Obtain cellular related battery statistics
API to obtain cellular battery stats for power
drain diagnostics.

Test: Manual

BUG:67647477
Change-Id: Iffdb1471cd55847b6454313c94497ab2cd6533cc
2017-12-20 14:56:29 -08:00
Dmitry Dementyev
b8b030bdbb Add more methods to RecoverableKeyStoreLoader.
1) Methods to get key status.
2) Register pending intent to get notification about new recovery
snapshots.

Test: none
Bug: 66499222
Change-Id: I4d5f8c1a6581b5e08f4589e19961d93c499689e1
2017-12-20 12:07:24 -08:00
Eugene Susla
4b7c919e72 Communicate relevantEvents=0 for packages excluded from whitelist
Together with checking isObservableEventType this will result in a11y events
not being generated for packages that are excluded form a11y-service(s)
package whitelist

Test: cts-tradefed run singleCommand cts -d --module CtsAccessibilityServiceTestCases
Change-Id: Id65607aaccc7af7d870d009d609917ff3c6d0712
2017-12-20 10:41:12 -08:00
Sudheer Shanka
b2f83c16d6 Update BatteryStatsImpl to track per-procstate cpu times.
BatteryStatsImpl will track this data by reading from
/proc/uid/<uid>/time_in_state whenever process state changes
and will include this data as part of batterystats dump.

Bug: 66953194
Test: atest core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
Test: atest hostsidetests/incident/src/com/android/server/cts/BatteryStatsValidationTest.java
Test: atest core/tests/coretests/src/com/android/internal/os/BstatsCpuTimesValidationTest.java

Change-Id: Ibb3e07f518aaf7eea2a00bb95b95dc5f7e09552e
2017-12-19 15:52:25 -08:00
TreeHugger Robot
6348ddcd04 Merge "Make TOP_SLEEPING procstate more like a cached process." 2017-12-19 18:47:19 +00:00
TreeHugger Robot
0817c33271 Merge "Add RecoverableKeyStoreLoader implementation in LockSettingsService." 2017-12-19 03:17:29 +00:00
Sean Stout
9ebe2cb6fe Merge "Renaming a file causes it to be rescanned" 2017-12-19 01:14:30 +00:00
TreeHugger Robot
60a3c1e313 Merge "incidentd: Dumping java process meminfo data." 2017-12-19 01:07:49 +00:00
Dianne Hackborn
bad8d91056 Make TOP_SLEEPING procstate more like a cached process.
When an app is on the top of the activity stack but the screen
is not on, this doesn't really count as a top app in the normal
sense.  In particular, we'd really like to apply the normal
restrictions we have on background and cached apps: no network
access, no ability to use wake locks, etc.  (In other words, in
this state the app's activity is stopped, so from its perspective
it is no different than the user leaving it to go to another app.)

To do this, we change the order of the TOP_SLEEPING proc state
out from the range of foreground states down to between the
cached and background states.

Test: ActivityManagerProcessStateTest
Bug: 70808931
Change-Id: I994caba8c27553a452de75efa358be0e683d046f
2017-12-18 17:05:52 -08:00
TreeHugger Robot
4316d8ecde Merge "Move heavy-weight process state down to cached range." 2017-12-19 00:29:31 +00:00
TreeHugger Robot
492511701f Merge "Add popup item content to id/content where applicable" 2017-12-19 00:05:31 +00:00
Dmitry Dementyev
1aa96132bd Add RecoverableKeyStoreLoader implementation in LockSettingsService.
1) Updates to ILockSettings.aidl
Since we can't pass arbitrary exception using IPC, Serrvice
converts them to ServiceSpecificException with an error code.

2) Added RecoverableKeyStoreManager class which is used as interface
between RecoverableKeyStoreLoader implementation and
LockSettingsService.

Test: none
Bug: 66499222

Change-Id: I03b695bc0ced1a91ea7ca5de179e121053dfe416
2017-12-18 16:04:15 -08:00
Kweku Adams
983829fec5 incidentd: Dumping java process meminfo data.
Bug: 65750823
Test: flash device and check incident.proto output
Change-Id: I9b10daddf0580b3fab4ed7970fb838a605eef0e6
2017-12-18 15:19:13 -08:00
Dianne Hackborn
f097d42f0c Move heavy-weight process state down to cached range.
This allows us to generally treat heavy-weight processes in
the background as cached processes, applying all of the limitations
we want for such things -- disable wake locks, etc.

Test: run-am-test ActivityManagerProcessStateTest
Bug: 63937884
Change-Id: I7c140c8f48188f6aa9c09731e83e3db4e4405e77
2017-12-18 14:54:08 -08:00
Alan Viverette
d6558622e8 Add popup item content to id/content where applicable
Change-Id: I828357dcfd5f89851c6801d2f466fd84821697da
Fixes: 68930822
Test: Visual test in Google Maps
2017-12-18 09:41:17 -05:00
Sudheer Shanka
dcddaa57b9 Merge "Log if reading cpu freq times takes too long." 2017-12-16 20:12:40 +00:00
TreeHugger Robot
42c11e7a3a Merge "Make IMM more robust for window focus stealing" 2017-12-16 18:23:40 +00:00
Eugene Susla
de8ca1ef94 Add a 'unbounded method refs only' clause to PooledLambda javadoc
Test: proofread
Change-Id: I26f1ac6e61289769a75a629b7b2057d32237a560
2017-12-15 16:16:42 -08:00
Yohei Yukawa
2553e48886 Make IMM more robust for window focus stealing
This CL is a generalized version of my previous CL [1], which addresed
Bug 31056744 where InputMethodManager (IMM) fails to recover from
failure mode when IMMS#startInputOrWindowGainedFocus() failes because
the app's window is no longer eligible to be the IME target.

This CL finally addressed one TODO in that CL. InputBindResult now has
the error code, which allows us to force restart input upon the next
window-focus-in event.  This should make IMM much more robust for
that kind of failure modes.  For instance, Bug 70629102 is fixed as
demonstrated in a newly added CTS test case [2].  Hopefully this may
also fix Bug 31056744, which we still do not know how to reproduce.

 [1]: I60adb38013b063918b074c7b947649eada77b2c8
      8e9214b4bd
 [2]: I4ea24c87cbbd05e4e68ad7dfafb774c8520188e2

Bug: 31056744
Fixes: 70629102
Test: Added a test case for Bug 70629102
      atest CtsInputMethodTestCases
Test: Manually made sure that Bug 28281870 is still fixed:
      1. Open app that has EditText.
      2. Start Input.
      3. Long press the task switch button to start multi-window mode.
      4. Tap the EditText that is used in step 2.
      5. Make sure that the IME still works as expected
Test: atest CtsViewTestCates
Change-Id: I7572d4b9d678f3669ca54d55718877b145015777
2017-12-15 15:47:33 -08:00
Tony Mak
b7e6fd49a5 Merge setQuietModeEnabled and trySetQuietModeDisabled into one API
This is the first step to introduce a public API to toggle work mode.

All the callers actually have the similar bit of logic like this:
if (workModeOn) {
    trySetQuietModeDisabled(..)
} else {
    setQuietModeEnabled(...)
}
So, let's merge them into one API.

Test: Quick Settings -> Toggle work mode
Test: Settings -> Work profile settings -> Toggle work mode
Test: Turn off work mode -> Settings -> Turn on work mode in the suggestion
Test: Turn on work mode through tapping on work app

TODO: Allow foreground default Launcher to call the API
TODO: Allow privileged apps to call the API
TODO: Remove @hide
TODO: Write a CTS to toggle the work mode once it is public API

BUG: 70212757

Change-Id: Ibcdd43458c236eca929c5f934fea61be2e2be863
2017-12-15 16:27:48 +00:00
Pavel Grafov
d1319bb059 Merge "Introduce DISALLOW_UNIFIED_PASSWORD." 2017-12-15 13:47:55 +00:00
Pavel Grafov
c4f87e9ceb Introduce DISALLOW_UNIFIED_PASSWORD.
When DISALLOW_UNIFIED_PASSWORD is enforced by managed profile
owner, the user is disallowed to user single lock for both primary
user and the profile.

DMP.isUsingUnifiedPassword() can be called by DPC to check if
this restriction is obeyed.

Test: make cts-verifier
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases -t
  com.android.cts.devicepolicy.ManagedProfileTest#testIsUsingUnifiedPassword
Test: cts-tradefed run cts -m CtsAdminTestCases -t
  android.admin.cts.DevicePolicyManagerTest#testIsUsingUnifiedPassword_failIfNotProfileOwner
Bug: 63909482
Change-Id: Ib758e32d4bf4012d805185bce874f481e17576ba
2017-12-14 20:53:27 +00:00
Todd Poynor
1acf06a62a BatteryStats: Don't collect battery stats if no battery
If the device has no battery, or has a removeable battery that is
currently removed, do not collect battery statistics.

Bug: 34507420
Test: manual: dumpsys batterystats
Change-Id: Id8edb494f353a40c648f798690f611f89f464d34
2017-12-14 18:45:22 +00:00
Hugo Benichi
3220790917 Merge "Extend connectivity OWNERS" 2017-12-13 23:36:51 +00:00
Yohei Yukawa
f0bd6d95b5 Merge "SoftInput flag requires focused View to show IME" 2017-12-13 23:36:41 +00:00
TreeHugger Robot
2c2ce763b7 Merge "Add an API for setting a new brightness curve." 2017-12-13 19:19:53 +00:00
Sean Stout
574e170eea Renaming a file causes it to be rescanned
Previously, if a file was renamed, it would not be rescanned by the
media scanner. This caused for sound names to reported incorrectly after
renaming a file.

Bug: 70583116
Test: manual - rename a file in Alarms folder using downloads and ensure
new name is reflected

Change-Id: I42b9b4a4cda638d94b713575eb9e51feb2004cfa
2017-12-12 17:41:15 -08:00
Yohei Yukawa
cf68d52ce8 SoftInput flag requires focused View to show IME
Historically SOFT_INPUT_STATE_VISIBLE/SOFT_INPUT_STATE_ALWAYS_VISIBLE
have not required focused editor View [1] to work.  This is easy to
use, but also easy to tell IMEs to connect to InputConnection, which
is often recognized as a bug by users because often nothing happens
when the user taps the software keyboard.

This would become more obvious when we start allowing nothing to have
focus (Bug 68841055) in Android P.

Although how we should deal with "dummy InputConnection" is still an
open question, ignoring these SoftInput flags for apps that target P+
when there is no focused editor view is probably better than the
current behavior, where non-functional software keyboard is likely to
be shown.  The user is still able to show the IME by explicitly tap
the edit field.

As an implementation note, this CL trusts the targetSdkVersion
reported from the target application process, which is in general
unsafe.  That said, for this particular purpose it is acceptable.

 [1]: focused View that returns true from View#onCheckIsTextEditor().

Bug: 69256929
Test: atest CtsInputMethodTestCases
Test: atest FrameworksCoreTests:com.android.internal.inputmethod.InputMethodUtilsTest
Change-Id: I56682c7dee71d461687b9e80ab746d382fd55e0c
2017-12-12 09:33:26 -08:00
TreeHugger Robot
14f9635110 Merge "Use IBinder#shellCommand() for 'adb shell ime'" 2017-12-12 14:49:25 +00:00
Yohei Yukawa
926488d70d Use IBinder#shellCommand() for 'adb shell ime'
This is a preparation CL to add a new command to 'adb shell ime'.

Currently 'ime' command is written in Java language that relies directly
on the internal Binder IPC interface IInputMethodManager.

This is not ideal because:

 1. We have to keep maintaining IInputMethodManager methods used
    only by the 'ime' command.
 2. Adding new options to the 'ime' command is tedious when it
    requires new methods in IInputMethodManager.

With this CL, all features of 'ime' command are re-implemented inside
InputMethodManagerService (IMMS) on top of Binder's "shell command"
feature [1].  Like 'am' command was gone recently [2], now 'ime' command
is also a simple shell wrapper to forward options to 'cmd input_method',
which allows us to 1) reduce the code duplication and 2) give non-zero
status code when the command fails with Java exception.

 [1]: I76518ea6719d1d08a8ad8722a059c7f5fd86813a
      9461b6f91f
 [2]: Ia8187196af597046fd2e7092dbf19ce1dc1ea457
      1704e3cf0c

Bug: 70475949
Test: adb shell ime
Test: adb shell ime help
Test: adb shell ime dump
Test: adb shell ime list -a
Test: adb shell cmd input_method
Test: adb shell cmd input_method help
Test: adb shell cmd input_method dump
Test: adb shell cmd input_method list -a
Change-Id: I9a2dbbf1d4494addbe22c82e2c416eedc4d585f2
2017-12-11 17:24:55 -08:00
Hugo Benichi
626eed2ac8 Extend connectivity OWNERS
Also remove 'build.master@android.com' which is deprecated, not
declared by anybody else, and makes the linter unhappy.

Bug: 70394432
Test: built
Change-Id: I9c0ba41386129379f82259fcc5e745562b014fae
2017-12-12 09:14:23 +09:00
Sudheer Shanka
ac5b88f642 Log if reading cpu freq times takes too long.
Change-Id: I70b41b7faac6d849a1ed0edc74febbf579fad0a0
Fixes: 70526282
Test: manual
2017-12-11 15:36:35 -08:00