Commit Graph

10463 Commits

Author SHA1 Message Date
Marcin Oczeretko
5d4fd8afb2 Merge "CpuStats - Change the field used for the debug entries" 2018-12-06 13:40:18 +00:00
Olivier Gaillard
f9bb7f79c1 Merge "Use the calling worksource uid for trusted apps." 2018-12-06 12:47:45 +00:00
Marcin Oczeretko
8d8617469c CpuStats - Change the field used for the debug entries
Test: UTs
Change-Id: I99c2a332a3f1670e29321bd090ae861a57bf91e5
2018-12-06 11:13:34 +00:00
Wu Ahan
2abe8b3b9e Merge "Apply cache and preload mechanism to inline image notifications." 2018-12-06 03:36:05 +00:00
Olivier Gaillard
c17d280bab Use the calling worksource uid for trusted apps.
- Set ThreadLocalWorkSource to the work source uid when app has the
UPDATE_DEVICE_STATS permission. We only enable that in system server for
now.
- By default, set ThreadLocalWorkSource to the calling uid since we
always trust this value.
- If an app sets a work source uid without having the right permission,
we just ignore it (we do not throw an exception)

A follow-up commit will update the code to use the worksource from the
beginning of the call. Currently we get the work source at the end
inside of BinderCallStats, however the value might have been changed
when executing onTransact.

Test: atest binderLibTest BinderWorkSourceTest BinderCallsStatsServiceTest
Change-Id: I351b8ac2b31feececc46c73f373f198b9b603c7e
2018-12-05 23:12:13 +00:00
Charles Chen
e6b8f8d27b Merge "Make some IStatusBar APIs support multi-display(1/N)" 2018-12-05 14:35:25 +00:00
Charles Chen
24e7a9fdb5 Make some IStatusBar APIs support multi-display(1/N)
In this CL, we add parameter displayId in some IStatusBar APIs and also
group flags into an inner class and make it exist per display.

TODO: 1. We left SystemUi implementation in later CL.
      2. Investigate which part of disable should support multi-display
         after main function completes.
      3. Refactor registerStatusBar as an IStatusBar API.
Note: remove mLightsOutListener in NavigationBarTransitions since no one uses it.

Test: atest SystemUITests
Bug: 117478341

Change-Id: Ie50a72f5d18e1f055ff2be4f1d7ac06da0117051
2018-12-05 12:36:50 +00:00
Marcin Oczeretko
6a2e5241a8 Add on battery time to Binder/Looper stats
Binder/Looper stats data is collected only when the device
is on battery. Adding the time on battery to dumpsys output
will make it easier to analize the data.

Test: UT and manually checked dumpsys output
Change-Id: I0536e718399181cb62f5de6bbd24a6fb73c26e7e
2018-12-05 10:43:56 +00:00
Marcin Oczeretko
b8cd5c434b Merge "BinderCallsStats - add debug entries to output" 2018-12-05 10:23:24 +00:00
Eugene Susla
4aa2db1d55 Merge "Intersect requestedPermissions with that of current update's one" 2018-12-05 00:39:22 +00:00
Eugene Susla
31c9cd197b Intersect requestedPermissions with that of current update's one
Fixes: 120092266
Test: - install apk https://drive.google.com/file/d/1eh2mCz-0Ymm4TghOaf46ZHdn2-M8bm6i/view?usp=sharing
 - hardcode DefaultPermissionGrantPolicy to always run on reboot
 - adb reboot
 - ensure device bootloobs with an error from attached bug
 - apply fix
 - ensure device no longer bootloops
 - ensure no error in logcat
Change-Id: If2387e963b63231b0b99a55fdb7e75187d07bd07
2018-12-04 12:56:32 -08:00
Marcin Oczeretko
772e8f2689 BinderCallsStats - add debug entries to output
Test: UT and manually verified that debug entries are included in
adb shell dumpsys binder_stats

Change-Id: If6a64f7ac14d12323d0cb855b7603eb259e19630
2018-12-04 16:40:32 +00:00
Jorim Jaggi
c999d5ee84 Merge "A brave new world for window insets (2 and 3/n)" 2018-12-04 09:44:26 +00:00
Ahan Wu
de396fa85d Apply cache and preload mechanism to inline image notifications.
Inline image will consume 3x memory due to no cache implementation.
This patch apply cache mechanism to each ExpandableNotificationRow and
preloads images before inflation task.

Bug: 77956056
Test: runtest systemui, observe memory usage by AndroidProfiler
Change-Id: I2c488b1d98ddf2d4670904ed4b3e8028c0d0172e
2018-12-04 11:29:31 +08:00
Jorim Jaggi
b603095494 A brave new world for window insets (2 and 3/n)
Implements basic API's to control windows generating insets in
the new insets world.

Test: CTS tests will be added at some point in the future
Bug: 118118435
Change-Id: I722d2e58c68734ac131b12da3d9978e946292130
2018-12-03 21:53:09 +01:00
Olivier Gaillard
7949061843 Adds an overflow mechanism for binder calls.
This logic will ensure that we have a limit for the number of items we
track to make sure we do not use too much memory.

We still have an overflow per uid in order to properly attribute the cpu
usage to the uids.

Test: atest BinderCallsStatsTest
Change-Id: Ife9f7249bae35d5c61a6d35ac9d25437d213e959
2018-12-03 11:12:39 +00:00
Lucas Dupin
086c6fc0ae Let launcher modify window corner radius
Test: Manualy launch an app
Test: Press home when activity is on top of the stack
Test: Quick scrub
Test: Swipe up on the home button, swipe down
Test: Tap on notification on the shade
Test: atest ActivityLaunchAnimatorTest
Bug: 111514493
Change-Id: Ib7e29e7e07bf2a245ff949373af700b319e273fc
2018-12-02 04:32:13 -08:00
Jeff Sharkey
2ea404fd2a Merge "Method to determine isolated storage mode." 2018-12-01 22:37:35 +00:00
Kevin Chyn
3d9b0fc963 Merge changes from topic "biometric-refactor"
* changes:
  3/n: For passive modalities, add plumbing for "try again"
  2/n: Multi-modal support for BiometricPrompt
  1/n: Move BiometricDialog management to BiometricService
2018-12-01 05:04:02 +00:00
Eugene Susla
b9df101c9e Merge "Call roles granting only when packages changed" 2018-11-30 23:13:50 +00:00
Kevin Chyn
23289ef7b6 3/n: For passive modalities, add plumbing for "try again"
When "try again" is showing, authentication is canceled internally.
BiometricService caches the client's info so that authentication can
be restarted when "try again" is pressed. Because authentication
is not running when "try again" is showing, BiometricService also needs
to have a TaskStackListener so that BP can be dismissed and an error can
be sent to the client when the app loses focus.

IBiometricServiceReceiver has been split into two. One for BiometricPrompt
to receive messages from BiometricService, and another for BiometricService
to receive messages from SystemUI/<Biometric>Services.

When we get locked out, don't send the last onAuthenticationFailed
to the client, since "Authentication failed" will be shown briefly
and be replaced by "Device locked out" which is janky

Bug: 111461540

Test: Tested with requireConfirmation enabled/disabled
Test: Tested onConfigurationChange corner cases, e.g. when "try again"
      or "confirm" buttons are showing, rotate the device. Buttons
      persist correctly and don't appear when unexpected
Test: Tested task stack corner cases, e.g. when "try again" is showing,
      press home button. BP dismisses and client receives ERROR_CANCELED
Test: BiometricPromptDemo receives all callbacks

Change-Id: I62126708ce8db8b358c666a07aa7c39607642c9d
2018-11-30 11:34:35 -08:00
Eugene Susla
abdefbaeeb Call roles granting only when packages changed
This computes and stores a hash of significant (for PermissionController)
packages state for the time when granting last ran.

Test: - enable DEBUG flag
- using logcat ensure roles granted on first bootloader
- adb reboot
- ensure roles granting skipped
- disable a package
- adb reboot
- ensure roles granting ran on boot

Change-Id: Idaea40c0ea34feaedfbe357627201f85e66876d5
2018-11-30 10:58:47 -08:00
Misha Wagner
3beb2e460a Merge "Revert "Filter threads that have low total CPU usage for CpuTimePerThreadFreq"" 2018-11-30 18:10:34 +00:00
Jeff Sharkey
10ec9d8a42 Method to determine isolated storage mode.
Mostly designed for use by tests, but start using it elsewhere in OS
for consistency.

Bug: 119713234
Test: manual
Change-Id: I803671fd84547b75337bebf00c2fa2bdaf0f72e7
2018-11-30 10:52:02 -07:00
Hyundo Moon
9a908db9f4 Rename KeyEvent.isMediaKey() to isMediaSessionKey()
Since not all KEYCODE_MEDIA_* keycodes return true in isMediaKey(),
the naming can give confusion. This CL renames the method to
isMediaSessionKey() and revises its Javadoc.

Bug: 119789707
Test: make -j
Change-Id: I36786ccf5606977e6d971c13d77d950356561bda
2018-11-30 13:54:32 +09:00
Adam He
103e62a19f Merge "Added 8th and 9th argument to pooled lambdas" 2018-11-29 19:32:54 +00:00
Jorim Jaggi
9a94afc6ca Merge "A brave new world for window insets (1/n)" 2018-11-29 17:14:15 +00:00
TreeHugger Robot
8ce7d1d992 Merge "Add onActionClicked in NotificationAssistantService" 2018-11-29 15:43:29 +00:00
Jorim Jaggi
f96c90ac6c A brave new world for window insets (1/n)
This CL starts a journey to discover a brave new inset world. The
path to get us there may be rocky, but it's going to be rocky.

One of the main pledges of the new API is that an app can retrieve
what is causing a certain inset easily. For that, we need to
dispatch metadata who is causing what inset, such that we can query
it from the client side.

Furthermore, the client will be able to manipulate insets directly,
but also listen to animation changes. We don't want to go through
window manager for that, thus, there needs to be a local codepath
from (global window state -> WindowInsets).

Because we have these two requirements, we dispatch the relevant
global window state for insets, represented by InsetsState, and
dispatch it to the client. On the client side we take the frame
and the InsetsState and generate WindowInsets out of it.

Bug: 118118435
Test: InsetsSourceTest, InsetsStateTest, InsetsSourceProviderTest,
InsetsStateControllerTest
Change-Id: I2bfe9dda376512916261823fc2ee35cbedeb6731
2018-11-29 13:37:43 +01:00
Tony Mak
7d4b3a5f19 Add onActionClicked in NotificationAssistantService
This is added to report clicks on actions buttons to NAS.

BUG: 119010281
Test: atest SystemUITests
Test: atest RemoteViewsTest
Test: atest NotificationManagerServiceTest
Test: Manual. Tapped on the action (both normal and contextual) and
      observed the log.

Change-Id: I381994737d8c3185d3fabf9b6c481fd01a89a634
2018-11-29 11:43:53 +00:00
TreeHugger Robot
296f530755 Merge "Add a maxHeight LayoutParams for ResolverDrawerLayout." 2018-11-29 00:06:37 +00:00
Adam He
f1fcd494d2 Added 8th and 9th argument to pooled lambdas
Needed for Autofill Field Classification implementation

Bug: 118681526
Test: atest CtsAutoFillServiceTestCases
Change-Id: I0ecebc391a93928618f349a1fd1af6304ee44006
2018-11-28 14:26:37 -08:00
Jeff Sharkey
c583071b97 Merge changes from topic "exifz"
* changes:
  Track attribute ranges, parse additional times.
  Sane undefined behaviors for XmlUtils.
2018-11-28 16:03:04 +00:00
Misha Wagner
ed3d6070c1 Merge "Change the UID filter in KernelCpuThreadReader to only select UID 1000" 2018-11-28 10:37:04 +00:00
Kevin Chyn
e92cdae277 1/n: Move BiometricDialog management to BiometricService
The BiometricDialog management was done in AuthenticationClient, but
this is not great for the following reasons
1) The dialog lifecycle should not be 1:1 tied to the client monitor,
   since this restricts flexibility
2) Devices with multiple biometrics implemented on BiometricDialog
   will require extra work. Moving the dialog management up one layer
   should solve this limitation

BiometricService now sends both its own receiver and the client's receiver
to the appropriate <Biometric>Service. When the client is actually started
by the <Biometric>Service, it will forward the client's (BiometricPrompt's)
receiver to BiometricService. Lifecycle management is currently still in
<Biometric>Service since the platform still uses <Biometric>Service
directly. AuthenticationClient for BP is now started with the wrapper
receiver, which allows BiometricService to handle messages before deciding
if it should forward the message to the client.

Moving lifecycle management to BiometricService is currently not a great
idea since framework doesn't always go through BiometricService.

Also merged IBiometricPromptReceiver with IBiometricServiceReceiver

Bug: 111461540

Test: Negative button works (error received by demo app)
Test: Cancelling via back or tapping gray area works (error received
      by demo app), and hardware is no longer authenticating
Test: Dismissing BP via negative button or gray area returns only a single
      error and is not followed by ERROR_CANCELED (as expected)
Test: Error messages are delayed when BP is showing, not delayed
      when BP is not showing (pre-auth check errors e.g. no hardware)
Test: Lockout works
Test: Lockout counter resets upon successful auth
Test: Keys are unlocked properly for both implicit and explicit modes

TODO: Figure out multi-modal BiometricService / <Biometric>Service
      synchronization. Likely we keep the bundle in BiometricService
      and send random numbers (identifier) to <Biometric>Service. When
      each <Biometric>Service is ready, it should return the number. Once
      BiometricService receives all identifiers, it can then notify
      all <Biometric>Service to start authenticating.

Change-Id: I2b6fa57ed3c3cbccc7b0be30279f80fa46a8e917
2018-11-27 16:26:19 -08:00
TreeHugger Robot
dbbcf07ec5 Merge "Removes ASEC-related logic from the framework" 2018-11-27 22:32:35 +00:00
Patrick Baumann
fc2851e4d5 Removes ASEC-related logic from the framework
This change removes remaining ASEC-related logic from the framework in
preparation for install refactoring.

Bug: 109941548
Test: install still works
Change-Id: Ic7322038e45c026bcc59800a5a9fafdbb461021f
2018-11-27 12:56:14 -08:00
Jeff Sharkey
9bc99f8e50 Sane undefined behaviors for XmlUtils.
They should treat empty strings as undefined, just like null values.

Bug: 111892141
Test: manual
Change-Id: Ia3eadb1cd1562e73cfa786bfa7fec29994e60a7c
2018-11-27 13:38:58 -07:00
TreeHugger Robot
20dbbf22b8 Merge "Add onSuggestedReplySent in NotificationAssistantService" 2018-11-27 19:51:55 +00:00
TreeHugger Robot
fa2b85579e Merge "New Kernel Per-UID CPU Time Readers" 2018-11-27 19:28:24 +00:00
Tony Mak
2999670406 Add onSuggestedReplySent in NotificationAssistantService
This is added to report clicks on smart reply buttons to NAS.

Also refactored the code a bit by having SmartReplyView to use
SmartReplies and SmartActions object, rather than passing a long list
of arguments.

Test: atest SystemUITests
Test: Manual. Tapped on the reply and observed the log.
BUG: 111437455

Change-Id: I897fb46a304f4f7b80b2a6bc4db0ac39f6dc6e8f
2018-11-27 18:18:21 +00:00
Misha Wagner
e211934104 Change the UID filter in KernelCpuThreadReader to only select UID 1000
This will significantly reduce the amount of data we currently collect
with CpuTimePerThreadFreq

Test: build
Change-Id: I3558536a1bda9fb75d652320612cd7ec9ce3bdd0
2018-11-27 10:37:48 +00:00
Misha Wagner
9a30c11b47 Revert "Filter threads that have low total CPU usage for CpuTimePerThreadFreq"
This reverts commit 474e7bece0.

Reason for revert: Thresholding could cause confusion in data, and doesn't reduce data enough to solve problems.

Change-Id: I5bc8774212aced24e3a07fc3096402708e0d6418
2018-11-27 10:33:06 +00:00
Jeff Sharkey
9787a9459d Iterate on storage permissions model.
This change updates the permissions design to use app-ops for
controlling write access, which is only extended to the default app
for a particular collection type.

Bug: 119713234
Test: atest android.appsecurity.cts.PermissionsHostTest
Test: atest android.appsecurity.cts.ExternalStorageHostTest
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I40811ff175b3b8410b58ed901948a23a56f8a8c2
2018-11-26 12:00:35 -07:00
Misha Wagner
474e7bece0 Filter threads that have low total CPU usage for CpuTimePerThreadFreq
Test: KernelCpuThreadReader::testReader_filtersLowTotalCpuUsage
Bug: 120016054
Change-Id: If09c8c01e6efffd0d7315613dc7425138528d39c
2018-11-26 16:25:59 +00:00
Marcin Oczeretko
8e90ada67e Merge "LooperStats - add debug entries to output for data validation" 2018-11-23 14:11:40 +00:00
Nicolas Geoffray
850f109ec8 Merge "Start using shared libraries class loader." 2018-11-22 10:24:38 +00:00
Nicolas Geoffray
8d144eb8bd Start using shared libraries class loader.
Change 1/2. Change 2/2 will setup the class loader namespace for
shared libraries.

This change sets up shared libraries class loaders for applications
and for dexopt.

bug: 111174995
Test: DexoptUtilsTest, device boots

Change-Id: Ie9a2b4eaa85cda59951703433f7a2d03bc12095d
2018-11-22 10:06:41 +00:00
Marcin Oczeretko
d32a513541 LooperStats - add debug entries to output for data validation
Test: UT and manually verified that debug entries are included in
adb shell dumpsys looper_stats

Change-Id: Ie2166974cffd18a719aaa06f6e3525eb0337d2a1
2018-11-21 11:51:16 +00:00
Misha Wagner
b96bd1a7d7 Add Pixel 3 time_in_state format parsing to KernelTimeInStateReader
Bug: 119090941
Test: Unit tests in ProcTimeInStateReaderTest

Change-Id: I598672809ccd44e6035ff7baf9f372a6d6cf211a
2018-11-21 10:37:37 +00:00