Commit Graph

10336 Commits

Author SHA1 Message Date
Alison Cichowlas
13f94032c7 Merge "Additional activity in new Chooser flow must also forward Results." 2018-12-10 18:45:19 +00:00
Yohei Yukawa
0c49908a02 Stop supporting null IME token in IMM#switchToLastInputMethod()
Hopefully no one has relied on this undocumented behavior that when
the caller has WRITE_SECURE_SETTINGS then null IME token is allowed in
IMM#switchToLastInputMethod().

Bug: 114488811
Test: CtsInputMethodServiceHostTestCases
Change-Id: Icb02c9bb52b11cff39b222198f4b67984676b9a6
2018-12-09 18:52:02 -08:00
Yohei Yukawa
70f17e7c1d Remove IInputMethodManager#switchToNextInputMethod()
It turns out that we had already rejected null IME token in
InputMethodManager#switchToNextInputMethod() since Android L [1].

Hence there is no need to keep this IPC any more.

There should be no developer-visible behavior change.

 [1]: I043aa30a19c821f33effd57dfd6590b0e3ed817b
      34c666472137a99a2ce5546b80bd04979d10ab7a

Bug: 114488811
Test: atest CtsInputMethodServiceHostTestCases
Change-Id: I72ee82d62e3bdce44f623604eca86ab3fe3df0bd
2018-12-09 18:51:38 -08:00
Alison Cichowlas
7b6f3b60a9 Additional activity in new Chooser flow must also forward Results.
Re-enable new Chooser flow.

Bug: 120417119
Test: Attach files in Gmail; ApiDemos.apk Content > Storage > Docs > GET_CONTENT
Change-Id: I4dc093e24c7415e10bfae0598038c3eb87029d5b
2018-12-07 15:06:59 -05:00
Adrian Roos
c894b352d6 Merge "FRP: save password quality in DPM.resetPassword" am: 08d4eb174d am: 635731866e
am: 38d5c1e8eb

Change-Id: I7e2780fbb9cd36cc23af5746aa6931ce761a0374
2018-12-07 03:42:03 -08:00
Adrian Roos
38d5c1e8eb Merge "FRP: save password quality in DPM.resetPassword" am: 08d4eb174d
am: 635731866e

Change-Id: Idcccada2ecdb5b1cf011d11dd239c1ee27169882
2018-12-07 03:32:45 -08:00
Adrian Roos
ebf84c264a FRP: save password quality in DPM.resetPassword
When setting a password from DPM.resetPassword(), the actual quality of the
password was not passed to LockSettingsService (instead, the minimum required
quality was passed which is often UNSPECIFIED). As a result, during FRP we
would see inconsistent state and skip it.

Bug: 110172241
Test: Set credential via DPM.resetPassword(), factory reset device to trigger FRP, verify FRP shows.
Change-Id: I54376f60ac53451ace22965d331b47cd8c2e614e
2018-12-06 19:29:39 +01:00
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
Nicolas Geoffray
c64eef6211 Merge "Start using shared libraries class loader." am: e7753e084f
am: 4879460f35

Change-Id: I0d3898a78d116aebb425a9a1cacb5dbac82b3e6d
2018-12-02 13:14:26 -08:00
Nicolas Geoffray
e7753e084f Merge "Start using shared libraries class loader." 2018-12-02 20:39:38 +00:00
Nicolas Geoffray
972b39e4e4 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
Exempt-From-Owner-Approval: PS1 was approved by owner, PS2 is a build fix.

(cherry picked from commit 8d144eb8bd)
Merged-In: Ie9a2b4eaa85cda59951703433f7a2d03bc12095d

Change-Id: I76383308418485ad6739f8a404d02c2771e4afe4
2018-12-02 20:39:29 +00:00
Jeff Sharkey
74c52585f4 Merge changes from topic "sqlitez" am: a920b9c85e
am: fd5131bba5

Change-Id: Id9ca077e14373ad19b2ac98ce65a89ea3fc2873e
2018-12-02 11:56:50 -08:00
Jeff Sharkey
1bf3db90f4 Revert SQLiteQueryBuilder for now. am: 6c90f1ded2
am: d551877fe8

Change-Id: I663ee9e0f55f9c53cba3cecc9c530470377c5ec9
2018-12-02 11:42:46 -08: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
0da04839b7 Support for appending "standalone" WHERE chunks.
The existing appendWhere() methods aren't very friendly for
developers, since they require manual tracking of state to decide if
subsequent standalone chunks should be prefixed with "AND".

While it's tempting to offer direct argument binding on the builder
class, we can't really deliver on that API in a secure way, so instead
add separate bindSelection() method which explicitly burns arguments
into a standalone selection string, which can then be appended to
the builder.

This was the last piece of new functionality being used by
SQLiteStatementBuilder, so we can delete that class and migrate
users back to SQLiteQueryBuilder.

Bug: 111268862
Test: atest frameworks/base/core/tests/coretests/src/android/database/DatabaseUtilsTest.java
Test: atest frameworks/base/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Merged-In: I418f24338c90bae8a9dad473fa76329cea00a8c5
Change-Id: I418f24338c90bae8a9dad473fa76329cea00a8c5
2018-12-01 17:23:05 -07:00
Jeff Sharkey
3e26b7db55 Extend SQLiteQueryBuilder for update and delete.
Developers often accept selection clauses from untrusted code, and
SQLiteQueryBuilder already supports a "strict" mode to help catch
SQL injection attacks.  This change extends the builder to support
update() and delete() calls, so that we can help secure those
selection clauses too.

Extend it to support selection arguments being provided when
appending appendWhere() clauses, meaning developers no longer need
to manually track their local selection arguments along with
remote arguments.

Extend it to support newer ContentProvider.query() variant that
accepts "Bundle queryArgs", and have all query() callers flow
through that common code path.  (This paves the way for a future
CL that will offer to gracefully extract non-WHERE clauses that
callers have tried smashing into their selections.)

Updates ContentValues to internally use more efficient ArrayMap.

Bug: 111268862
Test: atest frameworks/base/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Merged-In: I60b6f69045766bb28d2f21a32c120ec8c383b917
Change-Id: I60b6f69045766bb28d2f21a32c120ec8c383b917
2018-12-01 17:23:04 -07: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