Commit Graph

9524 Commits

Author SHA1 Message Date
Julia Reynolds
51eb78f8f8 Update alarm and messaging dnd filtering
- Check audio attributes on the notificationrecord, not the
notification (to take into account the notification channel audio)
- Allow notifications that use messaging style to be considered a
message for dnd

Test: runtest systemui-notification
Change-Id: I8e6a86ed62089a53fe71000e6d9da00f1c54b59e
Fixes: 74243745
Fixes: 74311423
2018-03-09 13:56:43 +00:00
dalyk
28011a4180 Add BaseNetdEventCallback class that provides no-op implementations for INetdEventCallback.
Test: None
Bug: 71828272
Merged-In: I261015d0d3e7e4159bb514742a6c588bfd34e795
Merged-In: I3a701fc52641615bf197f980022a61518c7347f4
Merged-In: I1ed5ede74ca14718e6d4f8a9a8d57de6026c9e93
Merged-In: Ib0c4b69a24144d27f672ec716fb9a8f06987ce7d
Change-Id: I75e0620f82195f18befe9dc079492a8c69bb764b
(cherry picked from commit 985d89a6e0)
2018-03-09 19:41:56 +09:00
Vladislav Kaznacheev
bf7cc38d1f Display shortcut inline with item title in cascading menu
Bug: 74208750
Test: run android.widget.cts.PopupMenuTest on a large screen device
  such as hikey960.

Change-Id: I1c4bca3cfecb012432e6cb89cb4cc0177ccc04f9
2018-03-08 23:08:41 +00:00
TreeHugger Robot
25ebcdb28c Merge "Remove PowerProfile.POWER_NONE" into pi-dev 2018-03-08 20:14:30 +00:00
Mike Ma
8db14d7d9a Remove PowerProfile.POWER_NONE
Change-Id: I49b3f3989a675bcb1ef83f5b86a55f3f5a0d3b2f
Fixes: 74389802
Test: com.android.internal.os.PowerProfileTest
2018-03-08 10:14:46 -08:00
Chenjie Yu
c8a6305ddf Merge "Refactor cpu stats pullers" into pi-dev 2018-03-08 00:24:00 +00:00
Chenjie Yu
ec67661bdf Refactor cpu stats pullers
use same cpu stats readers with BatteryStats so that
1) both throttle to avoid too frequent pulls
2) cached value is served within throttle interval to avoid double
pulling by both statsd and BatteryStats

To run unit tests:
bit
FrameworksCoreTests:com.android.internal.os.KernelUidCpuFreqTimeReaderTest
bit
FrameworksCoreTests:com.android.internal.os.KernelUidCpuClusterTimeReaderTest
bit
FrameworksCoreTests:com.android.internal.os.KernelUidCpuActiveTimeReaderTest

make -j56 statsd_test && adb sync data && adb shell
/data/nativetest64/statsd_test/statsd_test

Test: cts test, unit test
Bug: 73745189
Bug: 73780619
Bug: 73360959

Merged-In: I10a9bc91ca67fa812f4cd71c4fbd73c1a5ba580e

Change-Id: I10a9bc91ca67fa812f4cd71c4fbd73c1a5ba580e
2018-03-07 21:43:00 +00:00
Kevin Chyn
a3e5582fac Don't store lockout deadline in lockSettings
The deadline is enforced in gatekeeper, which persists after reboot.
Users should not see the lockout timer after rebooting the device if it
was previously in lockout, until an unlock attempt occurs.

Fixes: 66443036

Test: 1) fail pattern five times
2) reboot device
3) go to bouncer, lockout timer should not show
4) upon entering pattern, timeout should show (if done fast enough)

Change-Id: Ie07945b40c2f482fd1df7102ba96283ae9d98d75
2018-03-07 17:18:12 +00:00
TreeHugger Robot
2b00eaed27 Merge "IME API: rename IMS methods." into pi-dev 2018-03-07 00:19:55 +00:00
Mike Digman
4ef95e2531 Merge "Reset user rotate pref on navbar create" into pi-dev 2018-03-06 23:04:54 +00:00
Mike Digman
ab65025833 Reset user rotate pref on navbar create
System appears in portrait after restart, however rotation
watcher callbacks don't fire leaving user rotate pref stale
from last boot. Reset in onCreate and replace override logic
with policy's natural rotation.

Test: manual
Change-Id: Ia1f1e5f637708e5c678edbb5cbf9f4125e451103
2018-03-06 11:40:03 -08:00
Tarandeep Singh
164cfba536 IME API: rename IMS methods.
Incorporating API Review feedback:
* Use IMS.switchInputMethod(id) instead of IMS.setInputMethod()
* Use IMS.switchInputMethod(id, subtypeId) instead of
  IMS.setInputMethodAndSubtype()
* Renamed switchToLastInputMethod() to switchToPreviousInputMethod()

Bug: 73954137
Test: atest InputMethodServiceTest
Test: atest CtsInputMethodServiceHostTestCases
Change-Id: I6efd5ca473e33e6faeadb7eea7772b9d2b8ca12b
2018-03-06 02:23:15 +00:00
Mike Ma
07305c0b46 Power profile audio & video support
Add power consumed by audio and video hardware to power profile.
Attribute these power to specific app.
Bug: 70531798
Test: PowerProfileTest
Test: BatteryStatsHelperTest
Test: PowerCalculatorTest
Change-Id: I4811efa14ce97983258cd59bfd328181fe95baf4
2018-03-05 18:06:29 -08:00
TreeHugger Robot
f8f0c8df78 Merge "Revert "Introduce InputConnection#reportLanguageHint()"" 2018-03-03 23:36:37 +00:00
Phil Weaver
3fd86ed8d1 Merge "Change a11y shortcut default lockscreen behavior" 2018-03-03 03:35:34 +00:00
Chenjie Yu
ae1797d13d Merge "Avoid double logging for app overlay" 2018-03-03 03:26:23 +00:00
Yohei Yukawa
4397591f3d Revert "Introduce InputConnection#reportLanguageHint()"
This reverts commit e77386e8fb [1].

Reason for revert:
The protocol is not yet ready to be exposed and we are still unsure
what is the best approach.

 [1]: Ie86edafd1ed68b58f702116f561fc448fdbb57a8

Bug: 7031513
Bug: 72522601
Fix: 74087970
Test: atest CtsInputMethodTestCases
Change-Id: Ia61dc9b3d5b116199382994430fb16ee804942b3
2018-03-02 17:35:18 -08:00
TreeHugger Robot
b0ebe11b74 Merge "Report total latency instead of average for jobs last run" 2018-03-03 00:14:22 +00:00
Phil Weaver
c5865d6f1b Change a11y shortcut default lockscreen behavior
If the user hasn't chosen a preference, the shortcut
will not work on the lockscreen until the user agrees
to use the shortcut. After the user so agrees, the
shortcut will also work on the shortcut.

Bug: 70944865
Test: Adding a test for the new behavior
Change-Id: I41e1238fad43a4432cd341c6808e26ad6e155506
2018-03-02 16:00:43 -08:00
TreeHugger Robot
d59073ab2a Merge "Add hooks for custom global actions handling without a status bar." 2018-03-02 21:32:34 +00:00
TreeHugger Robot
df7105a993 Merge "Re-enable cross-profile use of spell checker APIs" 2018-03-02 21:20:47 +00:00
TreeHugger Robot
1bd402b86d Merge "Power profile improvement: support ambient display" 2018-03-02 19:15:34 +00:00
TreeHugger Robot
d289623ed0 Merge "More granular logging when proc file not exist" 2018-03-02 18:00:22 +00:00
Vladislav Kaznacheev
f1aab4de20 Merge "Add ViewConfiguration.shouldShowMenuShortcutsWhenKeyboardPresent" 2018-03-02 17:34:04 +00:00
Bo Zhu
0f0d1ab1d3 Merge "Check the public-key signature of the whole certificate file before accepting the certificates" 2018-03-02 08:52:36 +00:00
Mike Ma
eb0d8a7b91 Power profile improvement: support ambient display
Add ambient display power to power usage calculation.
Corresponding field in power_profile is "ambient.on"

Bug: 70531652
Test: PowerProfileTest
Test: BatteryStatsHelperTest
Change-Id: I4dfad12875af42de9d517c917b6c1e99323c9fbf
2018-03-01 18:40:16 -08:00
Chenjie Yu
08d6d728c7 Avoid double logging for app overlay
Right now if an app is TYPE_APPLICATION_OVERLAY, it gets logged twice

Fix: 73952594
Test: manual test and cts test
Change-Id: Ieca79545c76f0773cb939efd236705a067bb1e6d
2018-03-01 18:03:08 -08:00
Amith Yamasani
0ca706bb9e Report total latency instead of average for jobs last run
Instead of computing the average on the device, upload the
total sum of the latencies. Server can divide by the event count
if it wants to get the average.

Also change the latency buckets to 1 hr, 2 hrs, 4 hrs, 8 hrs and
greater than 8 hrs.

Bug: 70297451
Test: launch an app
      dumpsys batterystats --checkin | grep jbd,
      Observe the dumped values for the app

Change-Id: Iecda808594fc960fb16fa0407e5875bbc47db43a
2018-03-01 17:32:53 -08:00
Mike Ma
363ccf7282 More granular logging when proc file not exist
KernelCpuProcReader records a horrifying exception when the proc file
does not exist, creating confusion that this is the source of error.
Bug: 74074575
Test: KernelCpuProcReaderTest

Change-Id: Ib35e114cd78e1e9f424adf66da5eb85da9f6fe5f
2018-03-01 14:55:29 -08:00
Michael Kwan
2decbf7ae4 Add hooks for custom global actions handling without a status bar.
Bug: 31802693
Test: manual test
Change-Id: I24c312ccd06e3eee3563b2f9c16d620aa5b2421e
2018-03-01 13:13:20 -08:00
Yohei Yukawa
3f8c568883 Re-enable cross-profile use of spell checker APIs
Recently we successfully removed the restriction that up to one
SpellCheckerService can be active at the same time [1].  This still
makes much sense at high level, but at the ecosystem level there are
still some products / components that depend on the previous behavior
that child profile users can use parent profile's spell checker
service, which was originally introduced as a stopgap solution for
Android N MR1 [2].

Our decision for Android P for now is to revert back to the previous
behavior only when the calling process is running under work
profile.

At the implementation level, we can summarize the new behavior as
follows:
 * When TextServicesManager APIs are called from work-profile
   processes, those API calls will be evaluated with parent-profile's
   user ID to match the previous behavior [2].
   * If the currently selected spell checker is not a pre-installed
     one, then API calls from work profile will fail to match the
     previous behavior [2].
 * When TextServicesManager APIs are called from non work-profile
   processes, those API calls will continue being evaluated with
   calling user ID, as we planned for Android P [1].
 * TextServicesData will not be created for child profile users.

 [1]: I06c27ef834203a21cc445dc126602c799384527b
      06a2624049
 [2]: Iae9045ba5baccd04ed68906e7afb9160677ec4a5
      095fa37164

Bug: 63041121
Bug: 64718412
Bug: 70922751
Bug: 73609140
Fix: 73862883
Test: atest FrameworksCoreTests:com.android.internal.textservice.LazyIntToIntMapTest
Test: Manually tested with Test DPC as follows:
      * When AOSP Spell Checker is pre-installed and the current spell
        checker, both main profile and work profile can use AOSP spell
        checker.
      * When SampleSpellCheckerService is side-loaded and the current
        spell checker, only main profile can use
        SampleSpellCheckerService.
Change-Id: Ic046f832f203115106409a53418a5746eb6d4939
2018-03-01 13:10:23 -08:00
Adrian Roos
90c27c332a Merge "DisplayCutout: Add xml wrapper for layoutInDisplayCutoutMode" 2018-03-01 13:57:22 +00:00
TreeHugger Robot
06b1df657a Merge "Use start/finish app ops in window manager" 2018-03-01 01:11:25 +00:00
TreeHugger Robot
364eb30647 Merge "addModemTxPowerToHistory() made synchronized" 2018-03-01 01:06:38 +00:00
Siddharth Ray
a67fb56329 addModemTxPowerToHistory() made synchronized
BUG:73818082
Change-Id: Ie0cce10d993a696c5e915e8ef62a66f2cd453197
2018-02-28 13:54:43 -08:00
Bo Zhu
7f414d94fc Check the public-key signature of the whole certificate file before
accepting the certificates

This change requires an additional param to the initRecoveryService()
API to take in the public-key signature.

Bug: 73904566
Test: adb shell am instrument -w -e package \
com.android.server.locksettings.recoverablekeystore \
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Change-Id: I2aeead1fda51b6cd8df71ed3b5066342ebc8d5ea
2018-02-28 11:58:30 -08:00
Mike Ma
d2f8eca334 Toggle READ_BINARY_CPU_TIME
Test: N/A
Change-Id: I41403c16feffa61dd4e3ae13498ff63b26a1d4b2
2018-02-28 11:51:56 -08:00
Adrian Roos
2292031e3d DisplayCutout: Add xml wrapper for layoutInDisplayCutoutMode
Allows native apps to request a layoutInDisplayCutoutMode without
having to implement a custom NativeActivity subclass.

Change-Id: I0b7fd4624e89fabe177462d615360442f72a1e11
Fixes: 73807928
Test: atest PhoneWindowTest
2018-02-28 16:43:16 +01:00
Bo Zhu
2c8e5383c8 Add a new API to import a key provided by the caller, such that this key
can also be synced to the remote service

This API may be useful for backward-compatibility work, e.g., recovering
a key that's backed up in Android Q+ to Android P without updating the
Android P Frameworks code. This API may also be useful for other use cases.

Bug: 73785182
Change-Id: I1022dffb6a12bdf3df2022db5739169fcc9347d2
Test: adb shell am instrument -w -e package \
com.android.server.locksettings.recoverablekeystore \
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
2018-02-27 09:18:59 -08:00
TreeHugger Robot
837d2076ad Merge changes I7ce670f5,I0bd2de38
* changes:
  Preload with RELRO sharing in the WebView zygote.
  Make WebViewLibraryLoader interface more flexible.
2018-02-27 16:11:02 +00:00
TreeHugger Robot
bf4e3bc1bd Merge "Refactor KernelUidCpuTimeReader" 2018-02-27 10:24:28 +00:00
TreeHugger Robot
dcd6ae8bc8 Merge "Atom: TemperatureReported" 2018-02-27 07:00:45 +00:00
Tej Singh
4029831e36 Atom: TemperatureReported
Makes the temperature reported atom pulled, and adds CPU, GPU, and SKIN
temperatures. Pulls information from the thermal hal.

Test: CTS test on cl in this topic
Change-Id: I0a8e2d1135bdd77e1cc510f24ff5214ce9e14ead
2018-02-26 20:55:26 -08:00
Vladislav Kaznacheev
a725df9903 Add ViewConfiguration.shouldShowMenuShortcutsWhenKeyboardPresent
This method returns config_showMenuShortcutsWhenKeyboardPresent value.
It is necessary for the correct support library implementation of menus.

Bug: 31045453
Test: build and flash Android
Change-Id: Ibdd354b2d00f0c5f5ed91aa4840e942d772516ef
2018-02-26 16:22:34 -08:00
Mike Ma
69d8b3e050 Refactor KernelUidCpuTimeReader
Refactor KernelUidCpu*TimeReader, all extends KernelUidCpuTimeReaderBase.
Refined logging of these classes, avoid spamming system log.

Change-Id: Id8e149ce5be2595292a31de7fe6e1a94cef28bc1
Fixes: 73825907
Test: KernelUidCpu*TimeReaderTest
2018-02-26 15:39:52 -08:00
Phil Weaver
0f9aa4c3a5 Make a11y shortcut robust to services w/no summary
Fixes: 73254116
Test: Configure shortcut for TestBack. Now works.
Also adding test to internal test that fails without
this change.

Change-Id: I6bb1359f80c5e0145997bc107fe1580686edb30e
2018-02-26 13:49:41 -08:00
Svet Ganov
f7b4725375 Use start/finish app ops in window manager
Add infrastructure to app ops to specify how to treat mode_default
(for now only for startOp) allowing the caller to decide of this
mode should be treated as success - this is useful if the caller
already performed the default permission checks which determined
that the caller would perform the operation if the mode is default.
This way there is a record in the app ops history that this op
was performed. This is now used by the window manager service
which starts/finishes ops when an alert window is shown/hidden.
The window manager allows adding the window if the mode is default
but the caller has the fallback permission. In this case the
alert window would be shown and we want that noted in the op
history.

Now the window manager properly starts/finishes alert window op
when an alert window is shown/hidden. This is required to allow
SystemUI to badge notifications from apps showing alert windows
or add a dedicated notification if the app has no notifications.

Test: cts-tradefed run cts-dev -m CtsWindowManagerDeviceTestCases

      Added android.server.wm.AppOpAlertWindowAppOpsTest

      cts-tradefed run cts-dev -m CtsPermissionTestCases
          -t android.permission.cts.AppOpsTest

bug:64085448

Change-Id: I9041b1ac287bc5f9ed11d39bb203beba80f3f0f6
2018-02-26 13:29:13 -08:00
Torne (Richard Coles)
f4f647e2e0 Preload with RELRO sharing in the WebView zygote.
Now that the WebView zygote is a child of the system zygote it has the
smae address space layout and can use the existing WebView native
library RELRO file.

Preload the native library using the RELRO file in the zygote, to share
this data with applications which are using WebView. This can save up to
1-2MB of dirty memory, replacing it with clean pages that are shared
with more processes and thus have a smaller impact on PSS.

Bug: 63749735
Test: CtsWebkitTests
Change-Id: I7ce670f5fcddae9e98631e21329840ef3ad52f9a
2018-02-26 16:23:09 -05:00
Robert Berry
a3b994798d Remove account param from generateKey method
Bug: 73811828
Test: runtest frameworks-services -p
      com.android.server.locksettings.recoverablekeystore
Change-Id: If2f4174beea9cfb8c852139a7594815c377dbe7a
2018-02-25 14:48:42 +00:00
Robert Berry
f34ad9509d Merge "Remove packageName from getRecoveryStatus" 2018-02-25 14:08:47 +00:00