Commit Graph

10619 Commits

Author SHA1 Message Date
TreeHugger Robot
b5c226b1ca Merge "Sharesheet - image preview support" 2019-02-05 20:55:27 +00:00
TreeHugger Robot
6a98b6d236 Merge "Add PopupMenu#setForceShowIcon" 2019-02-05 20:00:57 +00:00
Yohei Yukawa
d20eef826c Query right user's system IMEs in AppRestrictionsHelper
It turns out that AppRestrictionsHelper#addSystemImes() has always
queried for the owner user's system IMEs despite the fact that it's
trying to query system IMEs for a restricted profile user.  This
behavior has not changed since its beginning [1].

Most likely people would not have noticed this though, because:

* Settings app does not show a menu item to create a restricted user
   on phone devices.
 * Even if it's available, most people do not use restricted users.
 * Even if someone created a restrected user, most likely the owner
   user and the restrected user share the same set of system IMEs,
   which are defined as "pre-installed" IMEs.

Anyway, AppRestrictionsHelper#addSystemImes() will start using a newly
introduced @hide API IMM#getEnabledInputMethodListAsUser() so that it
can query for the right user's system IMEs, instead of querying owner
user's ones.

 [1]: Ifced841ad3bfbde33d2403356216dd1749b7fa9a
      a7a93784d1f9798d37cb618def1a558f8d626f0f

Bug: 122164939
Test: atest SettingsLibTests:AppRestrictionsHelperTest
Test: manually done as follows.
  1. Build aosp_taimen-userdebug and flash it.
  2. adb shell pm create-user --restricted test_profile
  3. adb shell am start -a android.settings.USER_SETTINGS
  4. Click the gear icon next to the "test_profile" user.
  5. By adding a log, make sure that IMMS#getInputMethodList()
     gets called with userId = 10.
Change-Id: I5b50b5fe143c74c87b331bda3e5bcc4d6248436e
2019-02-05 10:45:32 -08:00
Eugene Susla
85114dc5fe Merge "Migrate system dialer config to RoleManager" 2019-02-05 17:38:16 +00:00
Beth Thibodeau
db4223b808 Merge "Adding seekbar to media notifications" 2019-02-05 17:32:28 +00:00
Mihai Popa
da59e1da16 Add PopupMenu#setForceShowIcon
The API enables developers to display icons for menu items. Before this,
the common workaround was to reflect in MenuPopupHelper (non-public
class), and call setForceShowIcon there.

Bug: 123769396
Test: atest android.widget.cts.PopupMenuTest
Change-Id: If4ef46bc7786a2e7e756a9b15c81147e0cce1090
2019-02-05 17:20:21 +00:00
TreeHugger Robot
a6a335def2 Merge "Add logging for tap-to-edit smart replies" 2019-02-05 16:44:39 +00:00
Matt Pietal
0ea391bc9e Sharesheet - image preview support
Use newer optimized image loading, which also helps reduce aliasing

Bug: 120419296
Test: atest ChooserActivityTest
Change-Id: Ic13ec0bae85f86b3d3d6a482cd86808b69dfb376
2019-02-05 11:13:22 -05:00
Yohei Yukawa
1fb13c59de Query right user's enabled IMEs in KeyguardPasswordView
This CL fixes a regression introduced by my previous CL [1], which
enabled InputMethodManager#getEnabledInputMethodList() to return the
result based on the caller's user ID, not based on the current IME
user, even when it gets called from background users.

Since Keyguard always runs as user 0 currently, it is now Keyguard's
responsibility for querying enabled IMEs with an explicit user ID.  To
do so this CL adds a @hide API IMM#getEnabledInputMethodListAsUser()
and lets KeyguardPasswordView use it.

 [1]: I192a0f5a1375170d17a4c08af94f23966dbaea8b
      7f8ee4b9dd

Bug: 122164939
Fix: 123904896
Test: Manually verified as follows.
  1. Build aosp_taimen-userdebug and flash it.
  2. make -j SoftKeyboard
  3. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
  4. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
  5. adb shell pm create-user test_user
  6. adb shell am switch-user 10
  7. adb shell locksettings set-password aaaa
  8. adb shell wm dismiss-keyguard
  9. Make sure that the IME switcher icon is not shown at the right
     end of the password field.
Change-Id: I6e7d7353c2b5b1da5d460ae005fb2585f85fb1c4
2019-02-05 07:55:28 -08:00
Felipe Leme
0a64976a09 Merge "Refactored how initial content capture events are sent." 2019-02-05 15:15:17 +00:00
Milo Sredkov
13d88111c3 Add logging for tap-to-edit smart replies
Log the status of getEditChoicesBeforeSending with the
SMART_REPLY_VISIBLE and SMART_REPLY_ACTION events.

Log whether the reply was changed before sending with the
SMART_REPLY_ACTION event.

Bug: 123407240
Test: atest NotificationManagerServiceTest SmartReplyControllerTest SmartReplyViewTest NotificationContentViewTest RemoteInputViewTest SmartReplyViewTest
Change-Id: I92bf9b9486f023e7a1ab553c24a9d021dc2f3133
2019-02-05 09:13:32 +00:00
Tarandeep Singh
73f9f9bf8f Merge changes Ib3997487,Ifed8351b
* changes:
  Link InsetsController to IME (IME transitons 4/n)
  Send IME control to client
2019-02-05 03:56:58 +00:00
Felipe Leme
01297698a1 Refactored how initial content capture events are sent.
The overall workflow of Content Capture is:
 - send initial structure
 - send deltas afterwards

Initially, the initial structure was being reported one view at time, which was causing janking.
This CL changes it so while that while the initial structure is being laid out, the content captures
are held. Then after it's finished, it traverses the structure and sends the initial events.

This change also allowed use to optimize the performance by caching the following state:
 - View.isImportantForContentCapture()
 - View.getContentCaptureSession()
 - Context.getContentCaptureManager()

Besides the performance improvements, this approach also has the following advantanges:
- It sends the VIEW_APPEARED events for the parent views before the events for the children.
- It send events to notify when the view structure layout is ready.

Bug: 123307965
Test: atest CtsContentCaptureServiceTestCases
Test: m update-api

Change-Id: I6db7cc11c6edf65cbffe42187fda82c84c3665ff
2019-02-04 18:28:15 -08:00
Ruslan Tkhakokhov
dd4fd2e23e Merge "[Multi-user] Support permission backup for multi-user" 2019-02-04 22:12:50 +00:00
TreeHugger Robot
98665da93b Merge "Make RoleManager inject DefaultBrowserProvider into PackageManager." 2019-02-04 22:09:28 +00:00
Beth Thibodeau
cb395358c5 Adding seekbar to media notifications
Test: manually tested, screenshots at https://drive.google.com/open?id=1rbiNM_2PG_Kyd4MWnDFUdQy-K3dAVKz3
Bug: 123698590

Change-Id: Ieb7bc6b379f78d1611f7a97615a13a3c0a993f9e
2019-02-04 15:42:02 -05:00
Tarandeep Singh
46d59f0ecb Link InsetsController to IME (IME transitons 4/n)
With this change, InsetsController.show/hide now links to IME. This also
takes care of animating IME along with other types.
Insets API are reactive i.e. they remain in sync with state of IME.

Test: atest InsetsControllerTest
Test: atest ImeInsetsConsumerTest
Bug: 118118435

Change-Id: Ib3997487bd19351d1d23bc70173fc9bdfd23a704
2019-02-04 12:41:24 -08:00
Ruslan Tkhakokhov
1583c8b995 [Multi-user] Support permission backup for multi-user
Bug: 123349308
Test: 1) atest RunBackupFrameworksServicesRoboTests
         2) atest CtsBackupTestCases
         3) atest CtsBackupHostTestCases
         4) atest GtsBackupTestCases
         5) atest GtsBackupHostTestCases

Manual testing (for system/secondary users):
  * Install Textra Sms (third-party sms client, requires sms
  permissions) and give permissions
  * adb shell bmgr --user [user-id] backupnow android
  * Uninstall and reinstall the app
  * abd shell bmgr --user [user-id] restore [token] android
  * Launch the app and verify permission dialog doesn't appear

Change-Id: I61ec4eb9c593465363dcf43059584b15f4aa81f5
2019-02-04 20:03:30 +00:00
Hai Zhang
85fd062239 Make RoleManager inject DefaultBrowserProvider into PackageManager.
This way PackageManager does not depend on RoleManager any more. Also
did some refactoring on RoleManagerService.

Bug: 123775970
Test: manual
Change-Id: I56c50d410ef212c960ffaa6212655b2f42870878
2019-02-04 10:37:07 -08:00
Olivier Gaillard
99ab9530d3 Bug fix: Do not track the looper exception if the session is not sampled
Test: atest LooperStatsTest
Change-Id: I1811ad12bdf9830699c615fff02f5aceea74c175
2019-02-04 13:42:30 +00:00
Olivier Gaillard
fcfdaced63 Merge "Fix a bug with worksource propagation." 2019-02-04 09:54:37 +00:00
James O'Leary
991761a424 Merge "Only selected VoiceInteractionService can call methods" 2019-02-01 19:00:41 +00:00
Olivier Gaillard
bab444a731 Fix a bug with worksource propagation.
It is properly added to the parcel when Binder.setCallingWorkSource is
called manually, however it does not work when we call
Binder.setCallingWorkSource in Binder#ProxyTransactListener. The problem
is that we are adding the worksource to the parcel too early. It is
called before we add the work source to the thread local
(ThreadLocalWorkSource.setUid)...

What currently happens
- Client code calls an AIDL method
- AIDL generated code calls writeInterfaceToken which add the headers to the parcel (including the worksource)
- AIDL generated code calls Binder#transact
- Binder#transact calls ProxyTransactListener#onTransactStarted --> this code is calling Binder.setCallingWorkSource too late. After writeInterfaceToken is called which is where the code calls Binder.getCallingWorkSource and add it to the parcel.

To fix it, we udpate the parcel request headers if the work source has
been fixed when the listener is called.

Test: atest binderLibTest BinderWorkSourceTest BinderCallsStatsServiceTest android.os.ParcelTest BinderProxyTest
Bug: 123744028
Change-Id: Id1a4565c1f096d38bf1e423bea897da77ff84005
2019-02-01 13:43:43 +00:00
Misha Wagner
3bca79c932 Merge "Add settings for KernelCpuThreadReader" 2019-02-01 10:44:12 +00:00
James O'Leary
596708b973 Only selected VoiceInteractionService can call methods
- Extract current code for checking caller into a private method
- Replace occurrences of that code with a call to the private method
- Add method call to setTranscription/clearTranscription/setVoiceState

Test: Verified Milford can't call setTranscription/clearTranscription
when it is no longer the active service.
Bug: b/123412646

Change-Id: I2c428c6c65b62f6a83264286df4f44fb5d1c249e
2019-02-01 02:21:58 -05:00
Yabin Cui
4d8546d4ba Make profileable_from_shell apps dumpable.
It is needed to enable linux perf events based profiling
on the profileable apps.

Bug: 118835348
Test: build and boot blueline.
Test: test profiling profileable apps manually using simpleperf.
Change-Id: Iba11fef81151f0c9e30b0478f1dd9e4ab1c5ac8d
2019-01-31 14:36:38 -08:00
TreeHugger Robot
cf8124dce6 Merge "Layout sharesheet content preview to match UX specs" 2019-01-31 18:40:38 +00:00
Matt Pietal
1fa7d803b6 Layout sharesheet content preview to match UX specs
Also add support for copying text to clipboard

Bug: 120419296
Test: atest ChooserActivityTest

Change-Id: I5482cb123e44f301f932e2854aa2ac94393b870b
2019-01-31 11:39:38 -05:00
Martijn Coenen
81973983b0 Merge "Allow app to specify class name for app zygote preloading." 2019-01-31 12:35:13 +00:00
TreeHugger Robot
bdd22d05a9 Merge "Consolidate wake-screen settings" 2019-01-31 05:30:10 +00:00
Varun Anand
066e326222 Merge "Add an API that allows VPNs to declare themselves as metered." am: 62a9b66a38 am: 9563c15d09
am: b8ae5b64a9

Change-Id: I74c6eceaa7444d0cc79fac3b94151a1bdeb63037
2019-01-30 20:11:09 -08:00
Varun Anand
b8ae5b64a9 Merge "Add an API that allows VPNs to declare themselves as metered." am: 62a9b66a38
am: 9563c15d09

Change-Id: Iab1d2a3bf27ec9c033253ccd48ce8026e3b18799
2019-01-30 19:39:50 -08:00
Varun Anand
62a9b66a38 Merge "Add an API that allows VPNs to declare themselves as metered." 2019-01-31 02:43:25 +00:00
Christian Wailes
a6fd7351cd Merge "Added OWNERS entries for some Zygote related files." am: 3ad8923842 am: 2f0392e6f7
am: c5de65d8f0

Change-Id: I4bae89b7d2996042f3a8e72ec1dcc78ba4fa4a27
2019-01-30 17:44:07 -08:00
Christian Wailes
c5de65d8f0 Merge "Added OWNERS entries for some Zygote related files." am: 3ad8923842
am: 2f0392e6f7

Change-Id: If5c42163657b9704bcd4e257a0869e4ee8345793
2019-01-30 17:29:36 -08:00
Christian Wailes
3ad8923842 Merge "Added OWNERS entries for some Zygote related files." 2019-01-31 01:04:28 +00:00
Varun Anand
1215f09b07 Add an API that allows VPNs to declare themselves as metered.
For VPN apps targeting Q and above, they will by default be treated as
metered unless they override this setting before establishing VPN.

Bug: 120145746
Test: atest FrameworksNetTests
Test: On device tests verifying meteredness setup correctly for apps
targeting Q and apps targeting P.
Change-Id: Ia6d1f7ef244bc04ae2e28faa59625302b5994875
2019-01-30 14:09:03 -08:00
TreeHugger Robot
f8e82809ef Merge "Widen allowed UID range for webview zygote." 2019-01-30 18:01:14 +00:00
Andrei-Valentin Onea
6706993777 Merge "Initialise hidden api usage logger pre-fork" am: 763747b7ce
am: c14670fc8e

Change-Id: I10aba0942a240ee041306c1bf24e6bed37e62f0a
2019-01-30 09:14:17 -08:00
Misha Wagner
4b32c9fbe9 Add settings for KernelCpuThreadReader
Settings include:
- Number of buckets
- UID predicate for which threads to collect data for

Test: to test UID selection: `atest KernelCpuThreadReaderTest`
Test: to test settings application: `adb shell cmd settings put ...` and
manual inspection of `pull-source`
Bug: 123562450
Change-Id: I9d97dfc1c120fcf1b04dadb6ce24863afeff053c
2019-01-30 16:24:00 +00:00
Matt Pietal
ffcf6e5460 Merge "Sharesheet content preview - adding text support only" 2019-01-30 11:58:51 +00:00
Martijn Coenen
d7b3a36959 Widen allowed UID range for webview zygote.
The webview zygote is shared for all users on the system, and so unlike
the app zygote, it can't use a single whitelisted UID range. For now,
clamp to the upper bound of the UID range, until we have a better idea.

This is still an improvement from the previous status quo, because it
will prevent setuid/setgid into system users.

Bug: 123597434
Test: builds, webview_zygote running
Change-Id: Ia975826ed5b1f20cabb46f60f5951723b1ba80c9
2019-01-30 12:24:17 +01:00
Neil Fuller
6bdf43af58 Merge "Track ZygoteHooks API changes in libcore" am: 20bca262f5
am: 97ba02c505

Change-Id: I3b377b6bd83cf6d7d293c89931ac13560e9db2c7
2019-01-30 03:19:42 -08:00
Andrei Onea
89acbab9c8 Initialise hidden api usage logger pre-fork
Topic: hidden-api-reporting-upcall
Test: m
Bug: 119217680
Change-Id: I8722f0bf4275fea4a8faf41d7b862c04b4014824
Merged-In: I80f82092ef779a7dc1f1322cb7c05ebf5e59939b
2019-01-30 11:17:07 +00:00
Martijn Coenen
fb7caa96f9 Allow app to specify class name for app zygote preloading.
Instead of using a fixed class name, define an interface for
preloading application code that must be implemented by applications
that use the application zygote.

Also, add an ApplicationInfo parameter to said function, so the app
knows where to look for its data and code.

Bug: 111434506
Test: atest CtsApptestCases:ServiceTest
      atest CtsSeccompHostTestCases

Change-Id: I1f8472da89dc90562dcb4e479e3d87ebf49b926c
2019-01-30 09:57:19 +01:00
Martijn Coenen
20f1a5d3ab Merge "Allow app zygote to keep APK / shared libs open across fork." 2019-01-30 07:59:01 +00:00
Lucas Dupin
e3218c1acd Consolidate wake-screen settings
Test: manual
Bug: 111414690
Change-Id: I8e0eee3ea00b1eb9cbe534cc60bfccec43cf8e31
2019-01-30 05:16:46 +00:00
TreeHugger Robot
b86259f639 Merge "Schematize Crypto system properties" 2019-01-30 03:51:31 +00:00
TreeHugger Robot
1444690e53 Merge changes I1d901692,I3e0bca75
* changes:
  ControllerLink: Remove unused parameter asSystemService
  MediaController: Remove dispatching key event as system service APIs
2019-01-30 01:53:50 +00:00
Evan Laird
a194630221 Merge "Add StatusBarManager#disableForSetup(boolean) @SystemApi" 2019-01-30 00:20:19 +00:00