Commit Graph

14719 Commits

Author SHA1 Message Date
Issei Suzuki
9178eee8b1 Merge "Add inheritShowWhenLocked System API to activity." 2019-01-14 14:34:45 +00:00
Julia Reynolds
413ba846b3 Don't allow importance updates for oem locked channels
Test: atest, make sure missed call notifications are no
longer demoted by aosp notification assistant
Change-Id: I80728bae67501d64359e0dac02dca928c34a7e95
Fixes: 122657004
2019-01-14 14:03:55 +00:00
Issei Suzuki
74e1eb2220 Add inheritShowWhenLocked System API to activity.
Let an activity show on top of the lock screen if the activity behind
this can be shown on top of the screen. This is pre-requisite for
showing permission dialog on top of the lock screen only when it makes
sence.

Bug: 109754623
Test: atest server.am.KeyguardTests
Change-Id: Ideaa2b77519649a70c682bc95277e451e149adad
2019-01-14 13:42:24 +01:00
Michal Karpinski
ceeadaed26 Merge "Temporarily whitelist processes to open activities from background when service-based PendingIntent was whitelisted" 2019-01-12 14:20:38 +00:00
Hai Zhang
85b762c9c8 Add home and emergency role names.
This change adds the names of the home and emergency roles, which will
be used by Settings.

Bug: 110557011
Test: build
Change-Id: I40bb0e021232acff62a32e0bdc24a04ff9ec6ba8
2019-01-11 14:35:10 -08:00
Eugene Susla
40335c1be9 Merge "Mirgate default SMS app handling to RoleManager" 2019-01-11 21:23:34 +00:00
Winson Chung
fb922e9bac Merge changes from topic "prediction_suggestion_services"
* changes:
  Initial commit of Content Suggestions (overview long press) Manager.
  Adding initial implementation of Prediction client/service API
2019-01-11 20:21:19 +00:00
Svetoslav Ganov
9a788837ef Merge "Historical app ops." 2019-01-11 18:48:55 +00:00
Garfield Tan
0c81667a08 Merge "Drop stale activity configuration updates." 2019-01-11 17:06:39 +00:00
TreeHugger Robot
cbdbc4d9c6 Merge "Add a privileged API for capturing and consuming bugreports" 2019-01-11 12:37:33 +00:00
Chalard Jean
fc758be231 Merge changes from topic "IPMS1" am: 3627deac88 am: 54d91e605c
am: 2304c7c508

Change-Id: I6908f68b1b9e7079384c4cc9f11c4e46cce694ce
2019-01-11 04:13:38 -08:00
Chalard Jean
2304c7c508 Merge changes from topic "IPMS1" am: 3627deac88
am: 54d91e605c

Change-Id: I2541996b9bfe338acabac858fdea0ad89d55df5b
2019-01-11 03:53:57 -08:00
Chalard Jean
8c141bdb8f [MS01] Add the IP memory store service.
Bug: 116512211
Test: Added initial tests
Change-Id: I9d9af4097e3e2d7afd9956b9cbfa29a9f9558ae0
2019-01-11 15:00:36 +09:00
Yohei Yukawa
a878b9500e Support per-profile IME behind the flag
In order to support BYOD (Bring your own device) use cases, Android
phones can associate multiple users into a single profile group so
that other system components such as launcher can help users
seamlessly switch user identity without doing a heavy-weight
device-level user switching.

For instance, an Android device can be configured to work for two
different users Alice and Bob, while Alice also has two different
identities: one as her private account and the other for her
work-related account.

  Profile group X == Alice:
    Parent user X (user id: 0)
      for personal account, under her control.
    Child user 1 (user id: 10)
      for work-related account, partly under system-admin's control.
  Profile group Y == Bob:
    Parent user Y (user id: 11)
      private account, under his control.

The above configuration allows system-level data separation not only
between Alice (user 0) and Bob (user 11) but also between Alice's
personal account (user 0) and Alice's work-related account
(user 10). For instance, Calendar app that runs under user 0 cannot
see any data for other users including user 10.

IME is one of known exceptions in the above design. For instance, when
Alice is using the device, the system launches InputMethodService,
which is the code-level representation of IMEs, only for the user 0
then gives it a special ability to interact with all the applications
that run under the same profile group.

  Profile group X == Alice:
    IME works as user 0 but interacts with apps that run under
    user 0 and 10.
  Profile group Y == Bob:
    IME works as user 11 and interacts with apps that run under
    user 11.

Of course there are non-trivial imprications by sharing the same
instance of InputMethodService across profiles but this was basically
the only option when we initially introduced in Android 5.0 [1]
because of multiple challenges (schedule, complexity, performance
concerns, and so on). To to mitigate the risk, we also introduced APIs
that allow system administrators to whitelist what IMEs can be enabled
for the entire profile [2].  Even with such a whitelist feature, we
have received multiple feature requests to completely separate IME
instances by profile boundaries, like other applications behave.

This is why this CL was authored.

With this CL, a new runtime mode "per-profile IME" is introduced
behind the flag.  When the flag is enabled:

  * InputMethodManagerService (IMMS) may calls IMMS#switchUserLocked()
    from IMMS#startInputOrWindowGainedFocus() every time when a
    different profile's IME client gains IME focus.
  * SpellCheckerService also enables per-user mode, which has been
    temporarily disabled [3].
  * DevicePolicyManagerService no longer disable packages that contain
    system IMEs when creating a new profile user.
  * Following IME APIs start returning result based on the caller's
    user (profile) ID.
     * InputMethodManager#getInputMethodList()
     * InputMethodManager#getEnabledInputMethodList()
     * InputMethodManager#getEnabledInputMethodSubtypeList()

There are still multiple known issues though. Hopefully we can address
those issues in subsequent CLs.

 * Inline-reply from non-primary profiles is still dispatched to the
   main profile's IME because SysUI is always running under main
   profile (Bug 120744418).  This probably can be addressed by
   allowing the IME clients that have INTERACT_ACROSS_USERS_FULL to
   specify the target user ID in some @hide parameter.
 * IMMS#switchUserLocked() is not yet fully optimized (Bug 28750507).
   New client app's UI thread can be blocked more than 100ms,
   depending on the number of installed IMEs and the number of IME
   subtypes implemented by those IMEs.
 * Even after IMMS#switchUserLocked() is fully optimized, IMEs'
   cold-startups are known to be slow.  One way to optimize this is
   keeping binding to those IMEs, but doing so would require 1)
   non-trivial amount of code changes and 2) doubles RAM consumption.
 * Virtual keyboard settings page for profile users are not yet
   available (Bug 120748696).
 * Migration from shared-profile IME mode to per-profile IME mode is
   not yet supported (Bug 121348796).  By default, IME packages will
   be automatically disabled when a profile user is created.  This
   means if the device switches from shared-profile IME mode to
   per-profile IME mode, IME packages continue to be disabled hence
   the user cannot type anything for those profiles.

Anyway, there should be no behavior change unless the debug flag is
explicitly flipped.

 [1]: I3bd87b32aec69c3f8d470c8b29b144f4e849c808
      734983fff3
 [2]: I921888660d29a5370395db87adf75d4d106660c9
      9c9cbac5b71a23ed0dbab0f44cb78a820514cfc6
 [3]: Ic046f832f203115106409a53418a5746eb6d4939
      3f8c568883

Fix: 120709962
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: Made sure that there is no behavior change if the debug flag is
      not set as follows.
  1. Install Test DPC
  2. Enable managed profile with Test DPC
  3. make -j EditTextVariations
  4. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
  5. Open two EditTextVariations instances in split-screen mode
   5.1. One is for the main profile
   5.2. The other is for the managed profile
  6. Make sure that main profile's instance of AOSP Keyboard is used
     for both applications.
  7. Make sure that main profile's instance of Android Spell Checker
     is used for both applications.
  8. adb shell ime list -a -s --user all
      -> Only "com.android.inputmethod.latin/.LatinIME" is shown.
  9. adb shell dumpsys textservices
      -> Only result for user #0 is shown.
Test: Made sure that basic text input can be done with
      "per-profile IME" mode enabled as follows.
  1. adb root
  2. adb shell setprop persist.debug.per_profile_ime 1
  3. adb reboot
  4. Install Test DPC
  5. Enable managed profile with Test DPC
  6. make -j EditTextVariations
  7. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
  8. Open two EditTextVariations instances in split-screen mode
   8.1. One is for the main profile
   8.2. The other is for the managed profile
  9. Make sure that AOSP Keyboard will be re-launched to correspond to
     the focused IME client's user profile.
   9.1 When EditTextVariations for the main profile is focused,
       AOSP Keyboard for the main profile is shown.
   9.2 When EditTextVariations for the work profile is focused,
       AOSP Keyboard for the work profile is shown.
 10. Make sure that different instances of Android Spell Checker are
     used based on target application's profile
 11. adb shell ime list -a -s --user all
      -> "com.android.inputmethod.latin/.LatinIME" is shown for both
         user #0 and user #10.
 12. adb shell dumpsys textservices
      -> Both user #0 and user #10 have results.
Test: atest DevicePolicyManagerTest#testSetPermittedInputMethods_failIfNotProfileOwner
Test: atest com.android.server.devicepolicy.OverlayPackagesProviderTest
Change-Id: Ied99664d3dc61b97c919b220c601f90b29761b96
2019-01-10 19:36:24 -08:00
Svet Ganov
8455ba2341 Historical app ops.
This change is the main check in for the historical app op feature.
The idea is to store a historical data about past app op rejections,
accesses, and durations per op for any UID state indefinitely.

Keeping all operations on record is not practical as app ops are
very frequently performed. To address this we are storing aggregated
data as snapshots where we store for every UID and its packages
how many times each op was accessed, rejected, lasted as an aggregate.

To allow history scaling indefinitely we are taking a logarithmic
approach with only the most recent state stored in memory and all
preceding state stored on disk. State on disk is stored in separate
files where each preceding file, i.e. for an older period, would
cover X times longer period with X number of snapshots covering
X times longer period. Initially X is ten but can be tweaked. For
example, the first file could contain data for ten days with daily
snapshots, while the file for older period would have data
for a hundred days with snapshots every ten days, etc.

The implementation is optimized for fast history update and no impact
on system runtime performance and minimizing memory footprint. We
are lazily persisting state to disk on a dedicated thread as this is
slow. We are also reading the relevant historical files on a query
as this is very rare as opposed to state updates.

The base snapshot interval, i.e. snapshot time span, in the initial
iteration and the logarithmic step are configurable. These can be
changed dynamically and the history would be rewriten to take this
into account.

Test: atest CtsAppOpsTestCases

bug:111061782

Change-Id: I55c32c79911ba12b2ace58d2a782b8df1e6bff60
2019-01-10 19:31:31 -08:00
TreeHugger Robot
c6536e4de6 Merge changes from topic "cc_virtual_id"
* changes:
  New, minor ContentCapture APIs for virtual views management.
  Implemented missing methods on android.view.contentcapture.ViewNode
2019-01-11 02:09:45 +00:00
Winson Chung
3fb0f258d3 Initial commit of Content Suggestions (overview long press) Manager.
Test: compile
Bug: 120865921
Change-Id: I9f8310112bedc883406f0f50a99041f542036fd9
2019-01-10 16:35:13 -08:00
Sunny Goyal
54e91344e2 Adding initial implementation of Prediction client/service API
Test: Build sample app, ensure that app prediction service gets client
      requests
Bug: 111701043
Change-Id: I33aceb2de31552b2d740dc333559d68728753e40
Signed-off-by: Winson Chung <winsonc@google.com>
2019-01-10 15:53:25 -08:00
Garfield Tan
0443b37c71 Drop stale activity configuration updates.
This CL introduces sequence number to activity configurations and use
that to compare their staleness. Always use the last reported activity
configs for Activity#onConfigurationChanged() and drop all requests
that are older than the processed one.

Fixes: 120189873
Test: Manually verify that number of configuration changes drops during
drag-resizing with a crafted app that needs 250ms to perform one
configuration change. go/wm-smoke too.
atest FrameworksCoreTests:ActivityThreadTest
atest WmTests:ActivityRecordTests

Change-Id: Ie0fd15458517470542a689b51283f4d1ed2ad4cc
2019-01-10 15:33:07 -08:00
Adam He
328c0e3841 Integrate content capture with FLAG_SECURE
Change-Id: I4e2c7d8063ca224d2037c01b7ddb24f8a7d85cbf
Fixes: 119254124
Test: atest CtsContentCaptureServiceTestCases
Test: atest android.contentcaptureservice.cts.LoginActivityTest#testStateDisabledByFlagSecure
2019-01-10 11:48:54 -08:00
Tyler Gunn
d7acc5a49f Merge "Call Screening / Caller ID API Changes" 2019-01-10 19:12:38 +00:00
Eugene Susla
4ab9511993 Mirgate default SMS app handling to RoleManager
This includes laying down some groundwork to make the remaining migrations
more straightforward

Bug: 110557011
Test: atest RoleManagerTest && atest SmsManagerTest
Change-Id: Ie96abd73751d10f521756c9dcdab2a5710ca2045
2019-01-10 10:41:10 -08:00
Nandana Dutt
d11850cd44 Add a privileged API for capturing and consuming bugreports
The API is mostly implemented; except for hooking up the listener
and handling an already running bugreport.

BugreportManager is the handle to the new API exposed to apps.

Generating bugreports requires root privileges. To limit the footprint
of the root access, the actual bugreport generation in Dumpstate binary,
is accessed as a oneshot service and dies after it finishes
running.

System server accesses Dumpstate via a binder interface since it does
not have root privileges.

Starting a oneshot service is done via setting a system property, which
needs to be done from system server. BugreportManagerService is the
new system server service that does this. BugreportManager calls into
BugreportManagerService via a binder interface, since the former is in
the app's process.

Both app to system server as well as system server to native service
calls are via implementations of IDumpstate binder interface.

Bug: 111441001
Test: builds. Flashed & verified it boots.
Test: wrote a test client (not included) and verified invoking
startBugreport works.

Change-Id: I4abeb753388c055c36ae0dd916af1ec8d40b7bf0
2019-01-10 17:33:58 +00:00
Michal Karpinski
c8aa91bd0a Temporarily whitelist processes to open activities from background
when service-based PendingIntent was whitelisted

Extends the mechanism added for broadcasts in ag/5779089.
The process can start activity from background when whitelisted
PendingIntent-based Service was started - for the next 10 seconds,
or until the service is stopped, whichever happens sooner.

For now, all this is only wired for notifications.

Bug: 110956953
Test: atest WmTests:ActivityStarterTests
Test: manual with Calendar notifications that are known
      for doing Service trampolines
Change-Id: If6ed2f5e22403c4df5abb6cf876ae89505e57380
2019-01-10 16:46:22 +00:00
TreeHugger Robot
58514eaa6f Merge "Add WindowConfiguration's bounds to proto" 2019-01-10 16:19:24 +00:00
vincentpeng
be09f2801e WallpaperColor's ColorHint API go for @SystemApi
Making color hint's relative api @SystemApi.
For pre-installed live wallpaper apps, change to @SystemApi so:

1. apps can be build with gradle build tools.
   (e.g.: PixelLiveWallpaper for app bundle feature).
2. apps can calculate and pass color hint information to interested system components.
   (Such as passing dark text support to SystemUi)

Fixes: 111395593

Test: make system sdk and check if the wallpaper apps can compile with android_system.jar.
Test: check whether the wallpaper apps can pass correct color hint after build (dark text).

Change-Id: I2ecf6ff77ff7a823949c6e3253a077e6eba9683a
2019-01-10 14:34:26 +00:00
Adrian Roos
5f8b52cb3e Add WindowConfiguration's bounds to proto
Test: make droid
Change-Id: I8334c51a3ffa6c33340869d24240ede1c9259c51
2019-01-10 14:25:02 +00:00
Felipe Leme
93ffb98e8e Implemented missing methods on android.view.contentcapture.ViewNode
Also fixed AssistStructure.ViewNodeBuilder.setVisibility() so it doesn't mess
up with the flags when it receives an invalid value.

Test: atest FrameworksCoreTests:android.view.contentcapture.ViewNodeTest
Test: atest CtsContentCaptureServiceTestCases

Fixes: 121135096

Change-Id: I2280c6922ca5a02aa4ed16ba3e8b39b9cb2f4b55
2019-01-09 17:36:43 -08:00
TreeHugger Robot
15bd09638f Merge "Updating Java doc for Activity#onUserLeaveHint()" 2019-01-10 01:11:28 +00:00
Louis Chang
c2e193a0c9 Updating Java doc for Activity#onUserLeaveHint()
Currently, Activity#onUserLeaveHint() may not have clear enough
information descripting when it would be called. Updating
document to also check Intent#FLAG_ACTIVITY_NO_USER_ACTION
for reference.

Bug: 121282783
Test: m -j PRODUCT-sdk_x86-sdk
Change-Id: I3894efbe286575140afbbba2ed059fd0f129ef3b
2019-01-09 16:08:29 +08:00
Varun Shah
8f7cd8787d Merge "Moved isAppForeground to ActivityManagerInternal." 2019-01-09 01:03:43 +00:00
Tyler Gunn
9e76fd19bc Call Screening / Caller ID API Changes
- Fix bug in call identification parcelable; was reversing the app name
and package name.
- Add @hide RoleManager consts for the Telecom roles; this will be
replaced by values in the library for public consumption as a later
date.
- Add new call direction attribute to the Call.Details class; this is
needed so that a CallScreeningService can know if a call is incoming
or outgoing.  This way it knows whether it needs to perform call blocking
or just caller ID.
- Update CallScreeningService API docs to explain how to request the
call screening role.
- Update InCallService API docs to explain the 3 roles related to this
service and how you declare an appropriate IncallService to fill each of
them.

Bug: 63966743
Test: Manual, CTS
Change-Id: Ic4547b8ead791690305f7be58e43272c4155b7fb
2019-01-08 15:01:19 -08:00
Michael Wachenschwanz
266dd3bfd7 Merge "Add Usage Reporting Api to UsageStatsManager" 2019-01-08 06:50:24 +00:00
Wei Sheng Shih
af7395db11 Merge "Support wallpaper on secondary displays.(7/N)" 2019-01-08 04:05:41 +00:00
Michael Wachenschwanz
36778525ba Add Usage Reporting Api to UsageStatsManager
The Usage Reporting Api allows apps to report usage within the app to
platform. Apps with the the OBSERVE_APP_USAGE permission may register
observers that use the reported in-app usage.

Test: manual (using the included Usage Reporter App)
Test: atest CtsUsageStatsTestCases:UsageReportingTest
Test: atest FrameworksServicesTests:AppTimeLimitControllerTests
Bug: 112486938

Change-Id: Iddd6f0993bbbf68a2032b34d473ef8d67da7747a
2019-01-07 14:56:06 -08:00
Varun Shah
98c84e193e Moved isAppForeground to ActivityManagerInternal.
Removed isAppForeground from the ActivityManager aidl and added it to
ActivityManagerInternal. Updated all of its references as well.

Bug: 119327603
Test: atest cts.tests.app.src.android.app.cts.ActivityManagerTest#testIsAppForegroundRemoved
Test: atest WifiServiceImplTest
Test: atest WifiLockManagerTest

Change-Id: I5c0fbe41df3cd00e02f8c0e1005fc9cf5832df77
2019-01-07 12:47:27 -08:00
Rob Carr
30e984ca78 Merge changes from topic "remove-scoped-connection"
* changes:
  Remove usage of scoped connections.
  Allow SurfaceControl to be passed over AIDL.
2019-01-07 20:08:58 +00:00
Chavi Weingarten
c0203f1268 Merge "Forward setVisibility call to SurfaceView for ActivityView." 2019-01-07 19:10:26 +00:00
TreeHugger Robot
42d3cf3647 Merge "Change the API for setting Notification Actions to be contextual." 2019-01-07 15:30:46 +00:00
Gustav Sennton
005d7a0d07 Change the API for setting Notification Actions to be contextual.
According to Android API council we shouldn't add a new semantic-action
flag to mark an action as contextual. Instead we should use a boolean
flag.
This CL adds that boolean flag.

Bug: 120842160
Test: build and run Notify app (in
vendor/google_experimental/users/cinek/), and ensure smart actions are
showing when the 'No Smart Actions' chooser is changed to
'Short Smart Actions'.
Change-Id: I5fc6dfa37ab28e3f29529cb6fda99c049783eb80
2019-01-07 10:59:45 +00:00
chaviw
d44449df80 Forward setVisibility call to SurfaceView for ActivityView.
SurfaceView setVisibility handles removing the surface already. By
forwarding the visiblity call from AV to the SV, SV will destroy the
surface. It will callback into AV through SurfaceCallback.surfaceDestroyed.
In the callback, AV removes the surface for the display, causing the
virtual display to turn off. When the virtual display is turned off, the
activities on that display will get stopped.

Test: ActivityViewVisibilityActivity
Change-Id: Iea8b57d7871b8c87457f2ae19485a610d0d74c38
2019-01-04 10:36:40 -08:00
Robert Carr
5fea55b2d2 Remove usage of scoped connections.
Tracking SurfaceFlinger changes. Now to construct a child surface
we need the SurfaceControl as opposed to just the surface, and so
we parcel the SurfaceControl across relayout.

Test: Manual
Bug: 62536731
Bug: 111373437
Bug: 111297488
Change-Id: I0a034767e92becec63071d7b1e3e71b95d505b77
2019-01-04 10:08:56 -08:00
Philip P. Moltmann
72401d4f77 Merge "Rename RuntimePermissionPresenter to PermissionController" 2019-01-04 17:32:44 +00:00
Antoan Angelov
e9da9aa821 Merge "Update provisioning checksum javadoc with SHA-1 hash deprecation." 2019-01-04 16:11:29 +00:00
arangelov
c2f4c1dbbf Update provisioning checksum javadoc with SHA-1 hash deprecation.
Test: none
Bug: 122346210
Change-Id: I0240be35240be685c5f40309c1b20efcd1255617
2019-01-04 14:45:10 +00:00
Michal Karpinski
4ea8d6188c Merge "Block activity starts from background when realCallingUid is a persistent system process and the start wasn't explicitly whitelisted by the sender" 2019-01-04 12:57:45 +00:00
Charles Chen
68b5a35cec Merge changes from topic "commandQueue"
* changes:
  Introduce AutoHideController to centralize call to WMS (4/N)
  Make Some APIs in CommandQueue aware of multi-display (3/N)
2019-01-04 06:39:25 +00:00
Philip P. Moltmann
bc054d8436 Rename RuntimePermissionPresenter to PermissionController
As this has already evolved from just presenting data. In the future any
permission related calls to the permission controller will be added here.

As the calls are protected by different permissions the binding will not
require a permission anymore, but each individual call checks the
permission.

Bug: 120221960
Test: Looked at settings UI showing data from this interface
Change-Id: I6b4a5c3b7ee17b145e11e2c1b6e11a8a232bffed
2019-01-03 11:39:43 -08:00
Wale Ogunwale
a7b3c1a7b2 Merge "Add support for singleTaskInstance displays" 2019-01-03 16:00:22 +00:00
Charles Chen
f3d295c58a Make Some APIs in CommandQueue aware of multi-display (3/N)
By this CL, we could dispatch Callback to fragments on the specified
display. I also add some annotations for documenting.

TODO: 1. add tests for multi-display.
      2. make registerStatusBar be an IStatusBar API to propagate the
         information when a display is added or in the initial step.
      3. Introduce AutoHideController

Test: atest SystemUiTests
Bug: 117478341

Change-Id: I864600f929c1d0c8aa39274f30c17b213b754d86
2019-01-03 22:12:38 +08:00