Commit Graph

10416 Commits

Author SHA1 Message Date
Felipe Leme
c0c15a3f90 Moved AutofillManager.SyncResultReceiver to an internal utility package
Bug: 121047489
Test: atest CtsAutoFillServiceTestCases # which is crashing due to unrelated issue

Change-Id: I4aba260e9878b1b420dfb7290f2389199c32a82f
2019-01-08 11:18:05 -08:00
Shafik Nassar
c4530c80b5 Merge "Display Default Browser on top in ResolverActivity" 2019-01-07 11:47:48 +00:00
Martijn Coenen
2ce0d86a77 Call into application to do AppZygote preloading.
For now, assume a class named <package_name>.ZygotePreload
exists, with a method named doPreload() to do the preload.

This should probably be replaced by having an entry in
the manifest.

Bug: 111434506
Test: preload called
Change-Id: Id632e46087eb5c719e6b310ffe007f76d3cbaf7d
2019-01-07 09:10:31 +00:00
Martijn Coenen
01e719bebb Allocate isolated UID ranges for app zygote and its children.
Introduce a new range of app-zygote isolated UIDs, [90000..98999].
For each app that uses an application Zygote, allocate a range of
100 isolated UIDs. The application Zygote for an app will get a
UID out of that range, and all other children that are forked
from that zygote will get a UID from the same range.

Bug:  111434506
Test: app Zygote and its children run in the new range of
      isolated UIDs (with SELinux disabled). New set of
      tests for UID allocators pass.

Change-Id: I7a6883a5ddb95683932c93ea77f4e52d8f37fa4f
2019-01-07 09:10:31 +00:00
Martijn Coenen
7e6fa6727c Initial support for application Zygote.
When an application has requested isolated services to be spawned
from an app zygote, we need to spawn the app zygote itself, and then
ask it to fork an isolated service.

The application zygote currently only creates the class loader, and
doesn't do much else. We keep track of the isolated services that
use the app zygote, and when the last isolated service goes away,
we stop the app zygote itself (after a timeout).

The app zygote itself runs with the app's UID and under the app
seccomp filter. That last one is too restricted, so this currently
only works with SELinux disabled.

Future CLs will add an application callback for preloading.

Test: start multiple isolated services with useAppZygote="true",
      verify app_zygote starts, services start as a child of
      app_zygote. Stopping all services stops app_zygote as well.

Bug: 111434506

Change-Id: I10ee1d4bd148c9298974d434fbc5e5eccbec16cb
2019-01-07 09:10:31 +00:00
Shubang Lu
00b976a7df Forward volume keys when system audio mode off and property set
cherry-pick ag/4968405

Bug: 80296335
Test: make; local tests
Change-Id: I04b7cd0958c9300a76f6337ee891b5f4947484ad
2019-01-04 22:11:05 +00:00
shafik
6cbef1973e Display Default Browser on top in ResolverActivity
This fix is a continuation for fixing 116610086
ResolverComparator identifies that it's dealing with a http/https scheme
The original behaviour was to prefer native apps that can handle that
specific URL over browser apps. This behaviour is preserved with the
exception of the Default Browser, as it will be preferred over all other
apps and will be displayed on top, then will be followed by native apps.

In addition, removed unused imports in ResolverComparator (import
ERRORs that prevented the pre-upload repo hook scripts from passing)

Bug: 116610086
Test: manually tested on device (Pixel 2XL) with multiple users
Test: atest ResolverListControllerTest
Change-Id: Ifd5da932c6f9d9cb4bf0a97985d0f9fb7bc2cb69
2019-01-04 14:49:24 +00:00
Rhed Jao
9aa8aa1c06 Merge "Refine spoken feedback string for a11y shortcut dialog" 2019-01-04 08:05:51 +00:00
Rhed Jao
5d9618bda1 Refine spoken feedback string for a11y shortcut dialog
Bug: 120038227
Test: atest AccessibilityShortcutControllerTest
Change-Id: I49e19655cd4a00830ff4d2cfbe16ae22b22eee49
2019-01-04 12:34:27 +08:00
TreeHugger Robot
25edac0f17 Merge "Ignore 'wake display' event when AOD is off" 2019-01-03 19:52:28 +00:00
Mathew Inwood
31755f94e1 Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: I020a9c09672ebcae64c5357abc4993e07e744687
2018-12-28 11:50:04 +00:00
Lucas Dupin
70bda67f0b Ignore 'wake display' event when AOD is off
Bug: 111405682
Test: turn off AOD, send wake-up signal
Change-Id: Iff33288ef0e5d4286b93eb3578f4f9795c593e5d
2018-12-27 16:14:02 -08:00
Yohei Yukawa
0c1ebffdb3 Deprecate null IME token rule in IMM#setInputMethod()
With my previous CL [1], InputMethodManagerService#setInputMethod() is
now guaranteed to be called only from IInputMethodManager and
IInputMethodPrivilegedOperations as 'adb shell ime set' no longer
directly calls this method (with null IME token).

With this CL, IInputMethodManager#setInputMethod(), which has been
kept just for null IME token rule, is finally gone. This is achieved
by letting InputMethodManager#setInputMethod() directly update
DEFAULT_INPUT_METHOD (and SELECTED_INPUT_METHOD_SUBTYPE) secure
settings if a priviledged component still relies on this undocumented
null IME token rule.

 [1]: I6fd47b5cc1e7da7222774df20247a2c69a70f45b
      db25df71be

Fix: 114488811
Test: atest CtsInputMethodServiceHostTestCases
Change-Id: I42dd0325b01c527009bf85566ca8ba0766b2294e
2018-12-27 14:06:28 -08:00
Lucas Dupin
de64ee0126 make wake event trigger a pulse
Test: manual
Test: atest ScrimControllerTest
Bug: 111405682
Bug: 111395593
Change-Id: I5a7b9024ecd5aea691ac5e3f23e70818186fc37c
2018-12-26 13:28:41 -08:00
TreeHugger Robot
af6721f945 Merge "Re-work IMM#getShortcutInputMethodsAndSubtypes()" 2018-12-25 07:54:56 +00:00
TreeHugger Robot
8a0e78af42 Merge "Stop supporting null IME token in IMM#setInputMethodAndSubtype()" 2018-12-25 05:22:05 +00:00
Yohei Yukawa
4773ee18a2 Stop supporting null IME token in IMM#setInputMethodAndSubtype()
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#setInputMethodAndSubtype().

Note that if the caller had WRITE_SECURE_SETTINGS they can achieve the
same goal by directly updating the following secure settings:
  * Settings.Secure.DEFAULT_INPUT_METHOD
  * Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE

Bug: 114488811
Test: CtsInputMethodServiceHostTestCases
Change-Id: Ic5c59299ace16778fc57a4ec2639508564f416a7
2018-12-24 21:13:53 -08:00
Yohei Yukawa
fefedc52bb Re-work IMM#getShortcutInputMethodsAndSubtypes()
It seems that InputMethodManager#getShortcutInputMethodsAndSubtypes()
was designed to be a bit more generalized concept, but in reality it
just ended up being a convenient API that returns a single Voice IME
subtype if exists.  As far as we can tell, It has never returned two
or mode pairs.  It also has never returned non-voice
InputMethodSubtype.

In order to support per-profile IME mode in InputMethodManagerService
without introducing a bunch of new complexity and technical debt, this
CL re-implements IMM#getShortcutInputMethodsAndSubtypes() based on how
it has been used actually in the ecosystem.

The first thing this CL changes is that
IMM#getShortcutInputMethodsAndSubtypes() no longer takes subtype
locale into account when looking for the best voice IME subtype. This
is because InputMethodSubtype is no longer a recommended way to
represent IME languages.  Ignoring subtype locale makes the
implementation much easier to understand and maintain.

The second thing this CL changes is that
IMM#getShortcutInputMethodsAndSubtypes() is now just a utility method
that is implemented in the client side on top of other well-defined
public APIs such as IMM#getEnabledInputMethodList() and
IMM#getEnabledInputMethodSubtypeList().  This means that this API
becomes per-profile IME ready for free once other public APIs become
per-profile IME ready.

 [1]: Ibd0f7ef5101013569c303820a3adc9038a97356d
      4e4569dab5

Bug: 120709962
Test: AOSP Keyboard still shows voice IME shortcut when the device has
      one or more IMEs that expose voice InputMethodSubtype.
Change-Id: Iaf31e9f3213f4e644b64c9658f1b59d371e3c2b4
2018-12-24 19:43:17 -08:00
Shafik Nassar
4808660569 Merge "Mitigate Intent Capturing vulnerability" 2018-12-24 16:13:03 +00:00
Adam Bookatz
89e8be4121 Merge "Statsd logs directly from Wifi & add Multicast tag" 2018-12-23 16:40:13 +00:00
Felipe Leme
bb98ed6521 New APIs for ContentCaptureService: onConnected() and onDisconnected()
Bug: 117944706
Test: atest CtsContentCaptureServiceTestCases:android.contentcaptureservice.cts.BlankActivityTest#testDisconnected
Test: atest CtsContentCaptureServiceTestCases

Change-Id: Iba3c1ae774221946a550fad95539d3a9771ae3d7
2018-12-21 15:11:49 -08:00
Felipe Leme
50b33dce59 Refactored ContentCaptureService (and infra) to have just one RemoteService.
The initial implementation of AbstractPerUserService assumed the
AbstractRemoteService instances would be created in demand, because that was
the aproach used by Autofill (to minimize the time system service is bound to
the autofill service process).

But for other systems like ContentCapture, it makes more sense to keep a
permanent connection to the remote service, which is running all the time, so
this change changes the infra to allow such permanent connection (which includes
defining an idle timeout value that never unbinds).

Bug: 117779333
Test: atest CtsContentCaptureServiceTestCases CtsAutoFillServiceTestCases

Change-Id: I43386a3fddc56f1dfd6e4e55f243eaa297921123
2018-12-21 13:25:07 -08:00
shafik
69df96321f Mitigate Intent Capturing vulnerability
ResolverActivity now identifies that the intent is a browsable intent,
and thus omits the Always button and replaces it with a settings button
tha can be used to configure the user's wanted behaviour.
Also prints out a message explaining that the user is giving the app
an access to open URLs from a specific host.

Bug: 116610086
Test: manually tested on device (Pixel 2XL) - will add unit test to
document behaviour

Change-Id: I81988b9a4d082bc1e6491186d39532fd283f2ede
2018-12-21 12:33:21 +00:00
TreeHugger Robot
af90060e91 Merge "Observe settings directly in ColorDisplayService" 2018-12-20 19:09:29 +00:00
Svetoslav Ganov
f0bfb0427c Merge "Make sure unsafeCheckOpRaw ops check raw ops" 2018-12-20 15:38:35 +00:00
David Brazdil
9ad1461eb9 Merge "Annotate two non-SDK methods known to be used by apps" am: de441278e7 am: 32d2f8fe46
am: a5083783f7

Change-Id: I59f5f3ea5a0424036e1e715e56d8fa16572358b1
2018-12-20 06:09:41 -08:00
David Brazdil
a5083783f7 Merge "Annotate two non-SDK methods known to be used by apps" am: de441278e7
am: 32d2f8fe46

Change-Id: I0d1a0e85eebb555ca43c2d43e6c28ce96af94122
2018-12-20 05:59:08 -08:00
David Brazdil
ad857d637a Annotate two non-SDK methods known to be used by apps
Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 121237128
Bug: 120783643
Test: m appcompat
Change-Id: Ib7a8bdf3151290aa8a5ca85dc8650612432f0d59
2018-12-20 13:36:21 +00:00
Christine Franks
57fdde8c0a Observe settings directly in ColorDisplayService
Bug: 111215474
Test: atest FrameworksServicesTest:ColorDisplayServiceTest
Change-Id: I312f3d1b48411a7db16024017982633a85ed6bda
2018-12-19 18:26:14 -08:00
Svet Ganov
9d528a1171 Make sure unsafeCheckOpRaw ops check raw ops
Test: manual

bug:119323172

Change-Id: Ic21d03af3a08bdca76821f2bc644482e7e5a1300
2018-12-19 17:25:52 -08:00
Philip P. Moltmann
22b8498815 Factor out service handling out of RuntimePermissionPresenter
Fixes: 121270006
Test: Looked at settings page that use RuntimePermissionPresenter
Change-Id: I3030511bce76fd0f30fac1ac922f6ff9f09ca80e
2018-12-19 13:40:17 -08:00
Philip P. Moltmann
29ee0a4827 Make AbstractRemoteService available outside of system server
The handler of the services now runs on Looper.getMainLooper()

Test: Built
Bug: 117779333
Change-Id: Ie2fee4ce19d6e6181537d8adc196a4ceab7eb0f8
2018-12-19 13:39:13 -08:00
Philip P. Moltmann
bee3e3347c Merge "Expose UsbPort and UsbPortStatus as system API" 2018-12-19 19:10:06 +00:00
Nicolas Geoffray
8c38fd7d02 Merge "Use the boot class loader as parent of system server loader." am: 7baf5a8d73 am: c2a38e56f3
am: 955963c109

Change-Id: I732692d12432b0bd0d5e3a313e49388d2cfc34ac
2018-12-19 01:21:39 -08:00
Nicolas Geoffray
955963c109 Merge "Use the boot class loader as parent of system server loader." am: 7baf5a8d73
am: c2a38e56f3

Change-Id: I5b467cd965f89240910f6a286d723a50d621b81b
2018-12-19 01:08:02 -08:00
Nicolas Geoffray
7baf5a8d73 Merge "Use the boot class loader as parent of system server loader." 2018-12-19 08:35:24 +00:00
Dianne Hackborn
2da290134f Merge "Add package information to association sources." 2018-12-18 23:58:33 +00:00
Philip P. Moltmann
4374ef8506 Merge "Add private APIs to watch noted app ops - framework." 2018-12-18 23:22:02 +00:00
Svet Ganov
b3d2ae2644 Add private APIs to watch noted app ops - framework.
This change adds simple APIs to watch for noted ops. We are now
reporting a callback for every note which could lead to too many
call but until this is found to be the case we stick to the simple
solution. We already have APIs to watch started and stopped ops
which in theory could have the same frequence as noted ops, so
this is consistent to our approach.

bug:117617221
bug:119323172

Test: atest androidx.test.runner.AndroidJUnitRunner

Change-Id: I46c4b00e765eb14df8c30471d2b80dda905b8125
2018-12-18 13:04:51 -08:00
Dianne Hackborn
24bbe58df6 Add package information to association sources.
This is often known by the system, though not always.  But when
we do know it, it is really useful to maintain that info so we can
do queries like "give me all of the associations that package X is
involved with".

Bug: 121146315
Test: manual
Change-Id: I0dd7aeb9147ecfd65a510d3b2a8bb4a0fbab57e3
2018-12-18 11:09:55 -08:00
Philip P. Moltmann
0ee6ee0a92 Expose UsbPort and UsbPortStatus as system API
This is needed by making the setup wizard use only system-api.

Test: Built, switched USB port state
Change-Id: I8e56859a5b36e7de91691522a34f7d6f62dcbb20
Fixes: 115301401
2018-12-18 08:50:46 -08:00
Gustav Sennton
d25a64da78 Add logging for smart replies and actions.
Log (using TRON)
1. when smart replies and actions are shown in a notification, and
2. when a smart action is clicked.

Bug: 120767764
Test: manual - use logcat to ensure we log the correct values when a
notification is expanded / smart action is clicked.

Change-Id: I85dbc3ee355997142ad71b7b67a759e8fede94b6
2018-12-18 16:23:09 +00:00
Nucca Chen
7a4f27a7e0 Merge "Add new netd event callback for changes to NAT64 prefix" am: ed30ec8dd1 am: dba2101a3c
am: 97de461dcb

Change-Id: Ib08d3c201a71876a057176e2fce065e8360008e2
2018-12-17 20:27:31 -08:00
Nucca Chen
97de461dcb Merge "Add new netd event callback for changes to NAT64 prefix" am: ed30ec8dd1
am: dba2101a3c

Change-Id: I4e263d78c48a07fbcbfddc63e118c45b4cfb9c5a
2018-12-17 19:52:40 -08:00
Nucca Chen
ed30ec8dd1 Merge "Add new netd event callback for changes to NAT64 prefix" 2018-12-18 03:19:45 +00:00
Jeff Sharkey
90dcdb2177 Merge "Local and remote isolated storage feature flags." 2018-12-16 16:50:08 +00:00
Tiger Huang
860ed7c688 Merge "Make per-display focus optional (1/2)" 2018-12-16 07:15:30 +00:00
Jeff Sharkey
b0c363b21e Local and remote isolated storage feature flags.
Moving forward as we start enabling isolated storage in various
dogfood groups, we'll need to maintain separate values for the
feature flag for both "local" and "remote" opinions.  Any strongly
expressed local opinion will always take precidence over any remote
opinion.

Any changes to these feature flags means that we need to invalidate
any PackageManager parsed APKs, since PackageParser changes it's
output depending on the flag state.  Since other feature flags are
likely to need this type of invalidation in the future, define the
PackageManager cache using a SHA-1 hash of a collection of values
that should invalidate the cache.

Bug: 112545973
Test: atest android.os.SystemPropertiesTest
Change-Id: Ifafcdf15e40e694eb4126e06981aeb82df51da33
2018-12-15 18:07:01 -07:00
Tiger Huang
51c5a1d042 Make per-display focus optional (1/2)
In general cases, we don't have multiple input methods simultaneously.
So that it may not make sense to have multiple focused window in the
system. Especially when there are multiple blinking cursors of input
boxes on different displays, the user may not be able to know which
input box can receive key events. In these cases, we let the system
has only one focused window.

In some cases, there can be multiple input methods simultaneously (one
for each display). To enable multiple users to interact with the
corresponding displays at the same time, we should let the system have
per-display focused window in these cases.

This CL makes per-display focus optional, and also reverts ag/5312657

Fix: 120241480
Fix: 120790099
Test: atest ActivityManagerMultiDisplayTests \
            CtsWindowManagerDeviceTestCases \
            WmTests

Change-Id: Ie030eed523599b217060887171710692d050e5d8
2018-12-15 16:30:14 +08:00
Olivier Gaillard
28109b5714 Use elapsedTime for binder/looper debug entries
Test: atest BinderCallsStatsTest LooperStatsTest
Change-Id: I631b82a2c9dd490cff3d1d2db9c717e069378bc0
2018-12-14 16:28:28 +00:00