Commit Graph

7325 Commits

Author SHA1 Message Date
TreeHugger Robot
ca19e3278b Merge changes I818e8db9,Ie24468be
* changes:
  Added a new API to colorize notifications
  Modified the interpolators when opening an ambient notification
2017-01-26 02:06:06 +00:00
Hakan Seyalioglu
2a27b2ca7c Merge "Mark two test methods public so they can be mocked" 2017-01-26 02:02:32 +00:00
Selim Cinek
7b9605b79c Added a new API to colorize notifications
Ongoing notifications can now be colorized.
This will use the color provided as the background
and invert most text colors

Test: runtest -x cts/tests/app/src/android/app/cts/NotificationTest.java
Bug: 34469375
Change-Id: I818e8db96c868d8bcde8f28c253efd581eeccaa2
2017-01-25 15:31:53 -08:00
Hakan Seyalioglu
96ba588a82 Mark two test methods public so they can be mocked
Without this, the mocked version looks like it's calling
the default implementation (which immediately fails due to
a bunch of null fields) - with this it just returns null.

I would ultimately like to stop mocking out the controller
and instead use a mocked package manager (which there is
already some set up to do). But in the meanwhile, this at least
gets the test passing.

Test: Checked the test passes.

Change-Id: I92d1f2796cfce21bf55e927bd56690c582f41e91
2017-01-25 10:51:53 -08:00
Rubin Xu
e7beedff6e Merge "Add unit tests for LockSettingsService" 2017-01-25 18:38:31 +00:00
Ying Wai (Daniel) Fan
896c7f8937 Merge "Correct the formula of battery capacity estimation." 2017-01-25 02:01:53 +00:00
TreeHugger Robot
b7cab6a190 Merge changes from topic 'bisto-request'
* changes:
  Allow privileged app to set media key event listener
  Allow privileged app to set volume key long-press listener
2017-01-25 01:16:32 +00:00
Chris Wren
5e02bca5cb Merge "Move MetricsReader to SystemApi" 2017-01-24 20:21:09 +00:00
Jaewan Kim
5026936e49 Allow privileged app to set volume key long-press listener
If the volume long-press listener is set, the listener will receive
the volume key long-presses instead of chaging the volume.

Privileged app needs permission
android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER to set the listener.

Bug: 30125811
Change-Id: I5e8fafbb950e5e11522da0f14004648d0877bf3e
2017-01-24 09:41:43 -08:00
Rubin Xu
0cbc19e4a6 Add unit tests for LockSettingsService
Add infrastructure and first sets of unit tests for LockSettingsService

Bug: 33126408
Test: runtest frameworks-services -c com.android.server.LockSettingsServiceTests
Change-Id: I4f3b7f6eaef7122f72b06bd11ce49134a093fe35
2017-01-24 17:40:04 +00:00
Yohei Yukawa
7383ce62ee Merge "Fix ImeSubtypeListItem#compareTo()" 2017-01-24 16:37:09 +00:00
Chris Wren
b62371434c Move MetricsReader to SystemApi
Test: runtest --path frameworks/base/core/tests/coretests/src/android/metrics  && runtest --path frameworks/base/core/tests/coretests/src/com/android/internal/logging/legacy/
Change-Id: If55f0444d5a836f24234182d298ebc128643efc1
2017-01-24 11:07:37 -05:00
Alison Cichowlas
3812446093 Merge "Tron - Omit overlong lines and warn when doing so." 2017-01-24 14:39:30 +00:00
Yohei Yukawa
410cc501b2 Fix ImeSubtypeListItem#compareTo()
It turns out that ImeSubtypeListItem#compareTo() does not satisfy the
contract of Comparable#compareTo(), which can trigger
IllegalArgumentException from Collections.sort() depending on the
runtime condition.

This CL makes it clear that two instances of ImeSubtypeListItem will be
compared with with those fileds in the following order.

  1. ImeSubtypeListItem#mImeName
  2. ImeSubtypeListItem#mSubtypeName
  3. ImeSubtypeListItem#mIsSystemLocale
  4. ImeSubtypeListItem#mIsSystemLanguage

Bug: 34255739
Test: adb shell am instrument -w -e class com.android.internal.inputmethod.InputMethodSubtypeSwitchingControllerTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I47f902cc8f5873926d238c30e462d08d7dbebcf7
2017-01-24 00:29:07 -08:00
Yohei Yukawa
8977e0693f Merge "Delay tasks from IMMS constructor to later phase" 2017-01-24 01:51:07 +00:00
TreeHugger Robot
e1c8372fb6 Merge "Fix NPE in LockPatternUtils" 2017-01-24 01:26:44 +00:00
Rubin Xu
4929a5d3b4 Fix NPE in LockPatternUtils
mDevicePolicyManager field can be null if getDevicePolicyManager()
is never called. A previous refactor removed an apparent unused call
to getDevicePolicyManager(), leading to NPE when mDevicePolicyManager
is accessed. We should always use getDevicePolicyManager() to access
DevicePolicyManager instance.

Test: manual
Bug: 34612758
Change-Id: Ic964b4ee4e3c56301295b8f0629bd005c732c5c4
2017-01-23 23:55:28 +00:00
Alison Cichowlas
38c4680aae Tron - Omit overlong lines and warn when doing so.
Test: updated LogBuilderTest

Change-Id: I0218acfacca53598a546cea5b3adeecd0d639031
2017-01-23 18:36:59 -05:00
Yohei Yukawa
7924782c00 Delay tasks from IMMS constructor to later phase
This is	a preparation CL for Bug 32343335.

This CL basically addresses the concern raised in a previous CL [1]
that added several synchnonized blocks in the constructor of
InputMethodManagerService (IMMS).

After hours of code reading and investigation, it is concluded to be
safe IMMS to behave as if there was no IME available until
SystemService.PHASE_ACTIVITY_MANAGER_READY phase. This allows IMMS to
register callbacks not in the constructor but in the later phase to
addresses the concern that object references to IMMS could be leaked
into different threads before IMMS object is properly constructed.

As far as performance is concerned, basically the amount of tasks
to be done in the main thread remains same, or could be reduced a bit
if some unnecessary callback events were skipped. To confirm this, we
can check the total number of the following performance metrics.
 - StartInputMethodManagerLifecycle
 - StartActivityManagerReadyPhase

 [1]: I9d4d3d7232c984432185c10c13fb726a6158cac8
      8f202f82fd86a3b40bc5e7d62779eddff21096b1

Bug: 32343335
Test: Manual: pre-installed IME on Direct-Boot disabled device
Test: Manual: pre-installed IME on Direct-Boot enabled device
Test: Manual: user-installed IME on Direct-Boot enabled device
Test: Manual: user-installed IME on Direct-Boot disabled device
Test: Manual: user switching scenario on Direct-Boot enabled device
Test: Manual: user switching scenario on Direct-Boot disabled device
Test: Manual: device unlocking scenario on Direct-Boot enabled device
Change-Id: I5b37c450db4b25b3e635b6d634293a34eec8b9d4
2017-01-23 15:26:15 -08:00
Aurimas Liutikas
4ced22d644 Merge "Port RecyclerView to com.android.internal.widget.RecyclerView" 2017-01-23 20:38:42 +00:00
TreeHugger Robot
2505b72247 Merge "Add ResolverActivity testing" 2017-01-23 20:32:53 +00:00
TreeHugger Robot
4a65687b85 Merge "Expose fonts.xml via public API with a service" 2017-01-23 19:57:23 +00:00
Hakan Seyalioglu
9149dcaf41 Add ResolverActivity testing
Still very basic, but will be adding as we find more issues pop up.

Test: Ran the tests
Change-Id: Ib9863509d140ff425ce446ecc876f53494d4fd0e
2017-01-23 10:43:03 -08:00
TreeHugger Robot
ec30d6e12f Merge "add a signaled reader to the eventlog" 2017-01-23 18:18:30 +00:00
Chris Wren
d09bf8271e add a signaled reader to the eventlog
Test: manual using a logspammer app
Change-Id: I89e3dda82d4d1d3fc6d343b634642687e550f70a
2017-01-23 11:40:52 -05:00
Clara Bayarri
04d72abde1 Expose fonts.xml via public API with a service
This change creates a new FontManagerService, in charge of providing
font management data. It exposes a public API to retrieve the
information in fonts.xml without accessing it directly. To do this,
it also refactors FontListParser's internal classes into a new public
FontConfig class holding all the font data.

getSystemFonts() returns all the available information in fonts.xml
as well as file descriptors for all the fonts. This allows us to
share the memory consumed by these files between all clients.

Bug: 34190490
Test: See attached CTS change in topic
Change-Id: I0e922f8bcc9a197a1988d04071eb485328d66fb7
2017-01-23 15:02:23 +00:00
TreeHugger Robot
af6668bc9d Merge "resolve merge conflicts of 5fa7fb1d9f to master" 2017-01-21 02:41:19 +00:00
Zac Iqbal
655f908aa6 Merge "Added an onDeviceUnlockLockout callback to TrustAgentService." 2017-01-21 01:35:43 +00:00
Jesse Hall
3bb7e5c909 resolve merge conflicts of 5fa7fb1d9f to master
Test: make
Change-Id: I7f119535a120303796fcd08f0274269f7d0dbaba
2017-01-20 17:04:48 -08:00
Zachary Iqbal
327323d2b3 Added an onDeviceUnlockLockout callback to TrustAgentService.
Test: Manually tested onDeviceUnlockLockout being called with an actual
TestAgentService implementation.

Notes:
- Active Trust Agents are no longer killed/unbinded from when a temporary
  device lockout occurs. Instead, the onDeviceUnlockLockout callback of
  the agent is called.

Change-Id: Ifa0984d1d7e5153568334d736e9ebd5a00ef1297
Bug: 34198873
2017-01-20 15:55:07 -08:00
Jesse Hall
5fa7fb1d9f Load EGL early in Activity launch, instead of in Zygote
Preloading EGL in Zygote was originally a memory footprint
optimization, but it turns out to be an important app startup time
optimization as well. Preloading EGL in Zygote is incompatible with
updatable graphics drivers, but we don't want to do it on-demand as
part of drawing the first frame either, since that increases
first-frame latency unacceptably.

This change removes Zygote preload, and instead loads EGL on a
low-priority background thread immediately after choosing which
graphics driver to use. This means it is usually done well before
drawing the first frame, without significantly disrupting other
activity launch work.

Test: observe systrace of Calculator launch on bullhead
Bug: 34404021
Change-Id: I887aa09bd35b088b16f53a89838a0c7c98f15761
2017-01-20 13:50:41 -08:00
Ying Wai (Daniel) Fan
9238b6124c Correct the formula of battery capacity estimation.
Instead of
  (current charge) * (current battery level percentage)
the formula should be
  (current charge) / (current battery level percentage)
to estimate the charge at 100% battery level.

Bug: 34255953
Fixes: 34255953
Test: formula change CL. No existing unit tests found.
Change-Id: I56ef7af3fb097a3082e0ef24329f522d2a0229cc
2017-01-20 13:29:01 -08:00
TreeHugger Robot
fa2000a487 Merge "Change KernelUidCpuTimeReader Slog.wtf to Slog.e" 2017-01-20 20:33:25 +00:00
Jeff Sharkey
8e8269fc11 Merge "StrictMode to detect untagged network traffic." 2017-01-20 17:31:59 +00:00
Adam Lesinski
196473955f Change KernelUidCpuTimeReader Slog.wtf to Slog.e
There is a known issue in the kernel uidcputime module that triggers
the WTF, which has a cost to the system. Convert to a regular log
instead.

Bug:28950306
Change-Id: I7cbb3138f644075f0d9d65ce8b52bd835eb270fd
(cherry picked from commit 82a4d6f93b)
2017-01-20 05:33:56 +00:00
Jeff Sharkey
619a511d4f StrictMode to detect untagged network traffic.
Network usage is tracked by the kernel at the UID level, which is
granular enough for normal apps, but large components (such as the
system server) are impossible to debug without adding additional
socket tagging to help identify subsystems within a UID.

To help ensure that system components tag all their network traffic,
this change offers a new StrictMode option to detect and report
untagged sockets.

Test: builds, boots, all common traffic tagged
Bug: 30943431, 30414041
Change-Id: I825c7941076054732264690247de2863342638e2
2017-01-19 20:52:05 -07:00
TreeHugger Robot
4c0659f531 Merge "Enable background restrictions" 2017-01-20 02:55:30 +00:00
TreeHugger Robot
d48fed9b55 Merge "Rename View.setTooltip/getTooltip to setTooltipText/getTooltipText" 2017-01-20 01:07:20 +00:00
Christopher Tate
42a386b771 Enable background restrictions
Apps that target O+ are always subject to background restrictions.
Legacy apps' background restriction is subject to the OP_RUN_IN_BACKGROUND
app op.

Apps with these properties are exempted from background restrictions:
  - persistent process
  - currently on the idle battery whitelist
  - global whitelist for things like bluetooth services

Bug 30953212

Change-Id: Icc19b2fbc05f40dcf8c3fc4abf718c373dc8d4f6
2017-01-19 16:23:02 -08:00
Aurimas Liutikas
7149a63961 Port RecyclerView to com.android.internal.widget.RecyclerView
Change-Id: I5d5912fee6f736bfc93d28ad53fc35e22be953c3
2017-01-19 13:26:36 -08:00
Vladislav Kaznacheev
6a944ca175 Rename View.setTooltip/getTooltip to setTooltipText/getTooltipText
Bug: 34454987
Test: android.view.cts.TooltipTest
Change-Id: I7203d5c61804b79584ba8449643c6c0f27a90747
2017-01-19 11:12:53 -08:00
TreeHugger Robot
bae6c26fdf Merge "Ensure we account for insets in minimized state." 2017-01-19 19:04:38 +00:00
Kang Li
002693910e Merge "Initialize Sharing Ranker with a pre-trained model." 2017-01-19 19:03:32 +00:00
Winson Chung
114aeea516 Ensure we account for insets in minimized state.
- When dragging slightly offscreen to minimize the PIP,
  ensure that the bounds take the insets into account so
  that the user can still interact with the PIP.

Test: Enter PIP in landscape, try to minimize it.

Change-Id: I093a37ba600722d44e50cc68dac77365a2ba062e
2017-01-19 08:54:29 -08:00
Chris Wren
26ca65d425 create a metrics log reader for tests
Add parallel logs using the new format for the old MetricsLogger
calls. Deduplicate these after the new reader implementation is
complete.

Test: ./vendor/google/tools/systemui/systemui_test_cookbook.sh
Change-Id: If12e1b66b0ec5ac23bd65e44df4f3c6d6931e722
2017-01-18 23:38:22 -05:00
TreeHugger Robot
b55db281da Merge changes I1606b184,Id78dd4ab
* changes:
  Publish StorageManager#openProxyFileDescriptor API.
  Add StorageManager#openProxyFileDescriptor.
2017-01-19 02:15:34 +00:00
Chris Tate
9e83cbbc10 Revert "Enable background restrictions"
This reverts commit 21f778060b.

Change-Id: I65586f9739da84fb32b51b0ea166b8288c41d1b3
2017-01-19 01:12:19 +00:00
Daichi Hirono
9fb00183a0 Add StorageManager#openProxyFileDescriptor.
The CL:

 * Adds StorageManager#openProxyFileDescriptor API.
 * Turns IProxyFileDescriptorCallback into a class so that it can provides
   default implementations.
 * Removes mActive state from FuseAppLoop, because the state will be managed at
   the MountService side.
 * Adds StorageManagerIntegrationTest to check if FUSE is correctly mounted or
   not. Since it's implementation details, CTS does not help to test the
   behavior.

Test: StorageManagerIntegrationTest
Bug: 29970149

Change-Id: Id78dd4abcf9325820e9c77c264f54bfa77b85a92
2017-01-19 09:24:00 +09:00
Kang Li
9988f36827 Initialize Sharing Ranker with a pre-trained model.
Test: manual shared images in Photos; webpages in Chrome; contacts in
Contacts, and ran unit tests.

Change-Id: If8c724a4085f1436b3e1e5d62754c6563f756915
2017-01-18 15:28:05 -08:00
Christopher Tate
21f778060b Enable background restrictions
Apps that target O+ are always subject to background restrictions.
Legacy apps' background restriction is subject to the OP_RUN_IN_BACKGROUND
app op.

Apps with these properties are exempted from background restrictions:
  - persistent process
  - currently on the idle battery whitelist
  - global whitelist for things like bluetooth services

Bug 30953212

Change-Id: Ib444829a2d222125f64ff19e8218823fa78373f9
2017-01-18 11:30:41 -08:00