Commit Graph

803 Commits

Author SHA1 Message Date
Julia Reynolds
a11d0b18ec Api review feedback.
Change-Id: I4628fcec43ec5dbacd208401d9ace2dbe658da64
Fixes: 35812235
Fixes: 35812334
Fixes: 35812179
Test: make
2017-02-28 17:59:31 +00:00
Felipe Leme
b72f012cb4 Added customization to SaveInfo.
Bug: 35727295
Test: CtsAutoFillServiceTestCases pass
Test: m update-api

Change-Id: I7eba36b6ab8181ae1cdbd10b0879927b9f9cf086
2017-02-27 10:14:41 -08:00
TreeHugger Robot
3b57462a86 Merge "Refactored savableIds() into a SaveInfo class." 2017-02-25 01:45:00 +00:00
Felipe Leme
f69761ffbe Refactored savableIds() into a SaveInfo class.
For now it's a "1-to-1" refactoring that keeps the same
functionalities, but soon SaveInfo will be expanded to
allow the AutoFillService to customize it.

Bug: 35727295
Test: CtsAutoFillServiceTestCases pass
Test: m update-api

Change-Id: I5aaa705be2b32590048f70ed0142437e05df94b7
2017-02-24 12:03:06 -08:00
Julia Reynolds
5098977b20 Change time methods to durations.
Test: cts, cts verifier, runtest systemui-notification
Change-Id: Ia612f59e91f3a3e1de14cd7217fe18ecaf61033c
2017-02-23 14:52:49 -05:00
Svet Ganov
eb49515abd Move the presentation view to proper location.
Test: Auto-fill tests pass

bug:33550221

Change-Id: I041a084800e761859c67b962fb4aefafce8956d8
2017-02-21 17:47:11 -08:00
Felipe Leme
fe35e69d96 Use ArrayList instead of ArraySet for FillResponse.getDatasets()...
...otherwise it might not preserve the order.

Test: manual verification
BUG: 35348724

Change-Id: Ib19d364253ea4f0cbbeca8a73b08800482e74820
2017-02-21 14:32:14 -08:00
Svet Ganov
00c771dc7d Add support for remote views backed auto-fill UI
Test: CTS and manual

Change-Id: Ia09f0208d78439491052e4886a0e71c387b73370
2017-02-20 00:37:33 -08:00
TreeHugger Robot
6f781be91e Merge "Minor improvements to help diagnose auth workflow." 2017-02-18 02:18:24 +00:00
TreeHugger Robot
6955665c73 Merge "Add escrow token APIs to TrustAgentService Security review: b/31273740 Design doc: go/auto_login Test: manual Change-Id: Ib11d4146135a58f1dc451ae8e081977a8f8e6ace" 2017-02-18 00:44:57 +00:00
Julia Reynolds
12054fdc87 Merge "Hide incomplete feature." 2017-02-17 22:30:12 +00:00
Felipe Leme
d633f07255 Minor improvements to help diagnose auth workflow.
BUG: 35348724
Test: CtsAutoFillServiceTestCases passes

Change-Id: I6ad3320faca8eed329b2cc4836281a547f57456a
2017-02-17 10:15:37 -08:00
Julia Reynolds
1327d3c3fa Hide incomplete feature.
Test: make
Change-Id: I505a8ee2f2fbdb574f607005579832951f28022a
2017-02-17 11:20:45 -05:00
Andrii Kulian
b047b8bd7e Report move to display for activities that handle config changes
When activity that is moved between displays handles all configuration
changes, it won't be restarted. This CL adds a callback to the client
to notify it about display change. Usually it will be followed by
onConfigurationChanged, except when configuration didn't actually change.
When activity is recreated, it won't receive onMovedToDisplay.

Bug: 34862802
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testOnMovedToDisplayCallback
Change-Id: I9a9501cab788623ada15a31efb53e4b2378639fe
2017-02-16 17:33:59 -08:00
Lingjun Li
93a145f688 Add escrow token APIs to TrustAgentService
Security review: b/31273740
Design doc: go/auto_login
Test: manual
Change-Id: Ib11d4146135a58f1dc451ae8e081977a8f8e6ace
2017-02-16 17:13:23 -08:00
TreeHugger Robot
4dba3cdf89 Merge "Refactor auto-fill" 2017-02-14 09:37:53 +00:00
Svet Ganov
782043caf8 Refactor auto-fill
* Fix a layering issue where auto-fill manager which is in view
  depended on activity which is in app

* Moved auto-fill classes to view or service based on their
  purpose and removed dependecy on the classes in view to the
  classes in service

* Push state to local auto-fill manager whether auto-fill is
  enabled to avoid making IPC for every focus transition if
  the user did not enable the feature

* Remove unnecessary offload to messages when handling calls
  to auto-fill manager service as these are made over a oneway
  interface and in general they do almost no work and typically
  we do these on the binder thread

* Removed id from data set and fill response as the provider
  can embed everything it needs to id them in the auth pending
  intent

* Enforce the auth UI to be only an activity as this will work
  with multi-window, recents, and back and also does not require
  draw on top of other app special permission

* Authentication also no longer requires passing a remotable
  callback to the auth activity but the activity handles the
  request as if called for a result

* Handling stopping of a user to clean up in-memory state as
  well as handling when a user gets unlocked as a provider may
  be non-direct boot aware

* User the correct context when creating an auto-fill manager

* Move the receiver that listens for requests to hide system
  windows to the manager service as the UI is a singleton and
  no need every per-user state to register its own

* Removed extras from dataset as the only case a provider needs
  to associate state with a dataset is for auth and the provider
  can embed this data in the auth pending intent

Test: manual and CTS

Change-Id: I4bc54c13cf779d7f6fdb3ab894637f9fac73f603
2017-02-13 21:31:37 -08:00
Winson Chung
8347163dbb Create a new stack for the assistant activity.
- Add a new stack that is not resized with multiwindow, and
  appears above the fullscreen and docked stacks, but below
  the pinned stack
- Add a method on VoiceInteractionSession to allow the assistant
  to launch activities into this new fullscreen stack.
- Also prevent any activities in the assist stack from the
  fetching of the on screen assist data.

Bug: 30999386
Test: android.server.cts.ActivityManagerAssistantStackTests

Change-Id: I22ab7629b5f758cf1e66d7d1c26648af6bc887c9
2017-02-12 14:52:15 -08:00
Svet Ganov
ef0c1885cb Move auto-fill shell command off IPC
Auto-fill has a shell command that is useful for development
which is currently exposed as a remote method allowing any app
to call it reflectively. Since only case this method is called
is when handling a shell command there is no need to expose it
to IPC over binder.

Test: manual

Change-Id: Iac20b4a39c7065e254f8aa277d1f2fd1c38b24a8
2017-02-10 15:14:49 +00:00
Felipe Leme
660ea8c6d7 Merge "Guarded access to mCallback and check for null before using it." 2017-02-09 18:17:54 +00:00
Felipe Leme
4997c505c9 Guarded access to mCallback and check for null before using it.
Fixes: 35143142

Test: manual verification
Test: CtsAutoFillServiceTestCases passes
Change-Id: I465538b896b617c518949611f963e350ee498f7b
2017-02-09 08:25:12 -08:00
Yohei Yukawa
a0e468ac33 Merge "Avoid sync IPCs from TSMS to SpellCheckerService" 2017-02-09 05:11:04 +00:00
Dianne Hackborn
59da805846 Add new VoiceInteractionSession.setUiEnabled method
This allows the session to turn off all of its UI.  Use it
in onCreate() to prevent the session from ever creating any
of its UI.  Switched the window creation and initialization to
happen lazily to support this.

Test: New test added to android.assist.cts.LifecycleTest
Bug: 30999386

Change-Id: I8eacb3697c8ac9908c50b9577abea2d20597b016
2017-02-08 14:00:31 -08:00
Yohei Yukawa
7fa65eef20 Avoid sync IPCs from TSMS to SpellCheckerService
Currently, TextServicesManagerServices uses an AIDL interface called
ISpellCheckerService when binding to a spell-checking service.
However, this interface uses synchronous (blocking) binder calls
rather than asynchronous (oneway) calls.  As a result, there are
situations where the system process has made a blocking binder call
into untrusted application code from its main looper thread.

As general policy, the system process must never allow its looper
threads to block on application code.

This CL addresses the above issue by converting ISpellCheckerService
into oneway interface, which instead takes a result receiver
ISpellCheckerServiceCallback so that spell-checking services can
return results asynchronously.

Note that the above protocol issue was also the root cause of
Bug 5471520.  Hence we can also logically revert the previous CL [1]
for Bug 5471520.

 [1]: Iedf2c2cdd8d4834545d06d72ade3ce211b104b1d
      4e713f1441

Test: Ran `adb shell dumpsys textservices` to check the
      "Spell Checker Bind Groups:" section in the following three
      steps.
      1. Before apps start requesting spell checker sessions.
      2. While apps are owning active spell checker sessions.
      3. After all the apps that owned spell checker sessions are
         gone.
      Made sure that spell checker service is not running when
      there is not spell checker bind group.
Bug: 7254002
Change-Id: I92e7aa40dc9ea14f67d355f0bfa15325b775d27b
2017-02-08 11:54:05 -08:00
Felipe Leme
bab851c7c9 Refined session management so Save can be automatically called.
This is yet another big refactoring:

- AutoFillManager keeps track of its current AutoFillSession.
- Views call AFM.startSession(View) when they can trigger autofill.
  (virtual views can call it as well). At this point, the manager
  sets an AutoFillSession, gets the activity token, and passes it to
  the service.
- Subsequent calls to AFM.start() will be ignored since the session
  is set.
- When the Activity is gone, it calls AFM.finishSession().
- Simlilarly, virtual views could call it as well.
- Added getAutoFillValue() to View.
- Removed AFM.updateAutoFillInput(childId): virtual views should now
  call startSession(childId) to start a session, and use the
  VirtualViewListener callbacks for updates.
- Change AutoFillValue to use String (which is immutable) instead of
  CharSequence for text values.
- Check if view is enabled before auto-filling.
- Removed 'cmd autofill fill' since it would require the appCallback
- Automatically dismiss the snack bar after 30s
- Moved the "don't change autofill value when autofilling" Inception
  logic into the service side.
- Etc...

BUG: 34819567
BUG: 33269702
BUG: 31001899

Test: manual verification
Test: CtsAutoFillServiceTestCases passes

Change-Id: I5fad928d4d666701302049d142026a1efa7291cd
2017-02-06 18:22:03 -08:00
Jason Monk
792e43cbe8 Merge "Add tile information to ACTION_QS_TILE_PREFERENCES intent" am: ff1d8da55e am: 74a8b6543f am: a8e10e5f20
am: 6e8c039e24

Change-Id: If9ed9697cc042375abd3d77b1eb4020d2798f96c
2017-02-06 15:56:38 +00:00
Jason Monk
a8e10e5f20 Merge "Add tile information to ACTION_QS_TILE_PREFERENCES intent" am: ff1d8da55e
am: 74a8b6543f

Change-Id: If195ccf536a45ef21e8ee70547ea76e26732c583
2017-02-06 15:47:39 +00:00
TreeHugger Robot
85a05cd9b5 Merge "Refactoring of auto fill - lifecycle, auth, improvements" 2017-02-06 05:47:45 +00:00
Akira Oshimi
8d2e9a9b30 Add tile information to ACTION_QS_TILE_PREFERENCES intent
One application can provide two or more custom Quick Settings tiles.
But there is no way to know which tile is long-pressed from application
side because ACTION_QS_TILE_PREFERENCES intent that is sent when
long-pressed doesn't have any additional information. So the component
name and state of the tile should be added to the intent.

Bug: 34832801
Test: manual - long press a custom tile

Change-Id: Iaa884cd944f19a2f007cbde645e8f8b1198bffb7
2017-02-06 04:45:13 +00:00
Svet Ganov
0f4928f1f7 Refactoring of auto fill - lifecycle, auth, improvements
1. Move management of the remote fill service in a dedicated
   class that abstracts away the async and ephemeral nature
   of the binding.

2. Update auth to move fingerprint out of the platform and
   allow response and dataset auth.

3. Cleaned up the fill and save callback classes.

4. The UI is now shared among all sessions and cleaned up.

5. Reshuffled the remote callbacks to have cleaner separation.

6. Cleaned up and tightened the reponse and dataset classes.

7. Added API to support communicationn with intent based auth.

Test: CTS + manually

bug:31001899

Change-Id: Idc924a01d1aea82807e0397ff7293d2b8470d4d6
2017-02-06 04:02:35 +00:00
Zak Cohen
56345f4bfe Introduces VrManager as a system service.
Provides access to persistent VR mode as used by VR viewer when a device
is believed to be inside a viewer.

Bug: 34736524
Test: Built, run using build of vr services that enables mode.
Change-Id: I6ff392f09adb8e4bd522dacbd064777bba836282
2017-02-05 17:33:44 -08:00
Felipe Leme
5523f9a2fc Merge "Improved AutoFill Save workflow." 2017-02-02 02:05:32 +00:00
Felipe Leme
0200d9ea15 Improved AutoFill Save workflow.
Currently, the onProvideAutoFillStructure() methods can be called
twice: to auto-fill an activity and to save the activity's data
in the service.

The problem with this approach is that when the save workflow is
called, the activity might have been gone. Hence, a proper approach
is to keep the initial AssistStructure data in the system_service
memory, watch for view changes, and then passed the new structure
back to the AutoFillService.

A side effect of this change is that we need another way to determine
if the view is sanitized or not. For "standard" views, that will be
defined based on whether the view content come from a resource or not,
but that logic is not implemented yet (for now, all views will be
considered sanitized, except for TextView passwords). For "custom"
views (such as WebView), this logic is responsibility of the view
implementation, through the newChild() method, which now takes a
flag (whose value could be AUTO_FILL_FLAG_SANITIZED for sanitized
views).

The SaveCallback.onSuccess() method was simplified: it does
not need a list of saved ids anymore the auto-fill UI will not use it
anymore.

Another side effect is that the Save notification is gone - until
it's attached again, it can be test by using:

    adb shell cmd autofill save

Finally, hook AutoFillUI on ACTION_CLOSE_SYSTEM_DIALOGS events.

BUG: 33269702
BUG: 31001899
Test: manual verification
Test: CtsAutoFillServiceTestCases passes
Change-Id: I907a7e21d1b3cd1ab6dec3a08d144a52655da46f
2017-02-01 11:00:15 -08:00
Julia Reynolds
a33f5c4312 Deprecate notification fields
And move references to the deprecated fields to
NotificationRecord for testability.

Test: runtest systemui-notification
Change-Id: If3910dc78297ad66679b1efa380315127261a018
2017-02-01 09:56:00 -05:00
Julia Reynolds
ceecfcf5cc Remove unneeded parameters
Test: cts-verifier
Change-Id: Ifaddd71aa44898c7c16f28f1715fd035861e3be6
2017-01-31 10:51:10 -05:00
Felipe Leme
bd00fef41c Moar AutoFill Framework refactoring...
* Encapsulated application-level auto-fill logic on AutoFillSession.
  Currently, Activity.java directly manages the IAutoFillCallback binder
  object used to auto-fill its views, but this logic need to be
  extended so Views can use it to draw the auto-fill bar.

* Pass auto-fill id and boundaries to requests
  So AutoFillUI can display its affordance in the right places.

* Uses a new auto-fill id on View (instead of reusing accessibility's).
  That allows moving the logic on whether a new request should be made or
  the existing UI moved to the service side.

* Split service methods in 2, for shell cmd and app
  And applied the right permission check on both.

* Removed CancelationSignal from onSaveRequest()
  Since it's not really needed.

* Etc...
  ¯\_(ツ)_/¯

BUG: 34637800
BUG: 31001899
Test: CtsAutoFillServiceTestCases passes
Test: manual verification

Change-Id: Ibd0cb2cfff6d0f6bb6b697a423ed5e89df687b82
2017-01-26 15:39:59 -08:00
Elliot Waite
0ce4b0e4c3 Fix @links in reference docs. am: 54de77470d am: ab978c035e am: 28ba4722a9
am: 9b21265b2c

Change-Id: If246ebdb36cf2832d5a6c42cbe752e290b6fb6e8
2017-01-26 04:49:33 +00:00
Elliot Waite
28ba4722a9 Fix @links in reference docs. am: 54de77470d
am: ab978c035e

Change-Id: If0d0613362e0ea95cf48eaf9a16d3eea48b589ea
2017-01-26 04:39:57 +00:00
Elliot Waite
54de77470d Fix @links in reference docs.
Change-Id: I40cea46efd80c448640ff69753698fe8404da40b
2017-01-25 17:00:55 -08:00
Felipe Leme
436ab6a91d Added support to authentication.
AutoFillService can now require user authentication, both at
FillResponse and Dataset levels;
- FillResponse authentication is typically used when the user data
  need to be unlocked before the first use.
- Dataset authentication is typically used to unlock sensitive data
  such as credit card info.

The authentication can be handled by the service itself (for example,
when it uses the credit card CVV to unlock it) or by the Android
system (when the service asks for fingerprint authentication).

Bug: 31001899

Test: manual verification
Test: CtsAutoFillServiceTestCases passes

Change-Id: If62f42f697ab5ef0d14d991ff1077d1c38808e61
2017-01-25 13:03:32 -08:00
TreeHugger Robot
000f7cd646 Merge "Initial IME integration." 2017-01-25 19:44:33 +00:00
Rubin Xu
e7beedff6e Merge "Add unit tests for LockSettingsService" 2017-01-25 18:38:31 +00:00
Julia Reynolds
717ca4b07d Merge "Allow notifications to be autocanceled at a time." 2017-01-25 16:03:38 +00:00
Julia Reynolds
2a128746b3 Allow notifications to be autocanceled at a time.
Test: cts
Change-Id: I24ebcab2c0fa2028ec5d2984dc3b7ec19391b590
2017-01-25 09:28:01 -05:00
Felipe Leme
3461d3c069 Initial IME integration.
- Created an AutoFillManager class, which provides methods to show
  the auto-fill bar for views and virtual nodes.
- Automatically launches an auto-fill request when the IME is shown
(and an AutoFillService is set for the given user) on TextViews.
- Updated VirtualNodeListener to use this new API.

BUG: 31001899
BUG: 34171325
Test: CtsAutoFillServiceTestCases passes
Test: manual verification

Change-Id: Id72ce97da70217081b5823cfc7b138412634fcf3
2017-01-24 17:57:16 -08:00
Jason Long
b04c54fdb3 Merge "Define contract for AutoFillServiceInfo more precisely." 2017-01-25 01:21:43 +00:00
Julia Reynolds
cf63ff1532 Snoozing API changes
- No one can snooze for an undetermined amount of time
- Only the assistant can unsnooze
- Listeners can retrieve a list of snoozed notifications

Test: runtest systemui-notification, cts verifier
Change-Id: Idfaee6d8bc15a5d41630f86f7e852468b07dc7d0
2017-01-24 16:18:52 -05:00
Jason Long
c121dda89a Define contract for AutoFillServiceInfo more precisely.
Change-Id: I295dec0c7318eecdceb962df9c0d888d12e9b654
Bug: 31001899
Test: Manual
2017-01-24 10:43:11 -08:00
Rubin Xu
0cbc19e4a6 Add unit tests for LockSettingsService
Add infrastructure and first sets of unit tests for LockSettingsService

Bug: 33126408
Test: runtest frameworks-services -c com.android.server.LockSettingsServiceTests
Change-Id: I4f3b7f6eaef7122f72b06bd11ce49134a093fe35
2017-01-24 17:40:04 +00:00
Julia Reynolds
924eed1ca6 Add updatable fields to Ranking
- NotificationChannel
- Badging

Test: runtest systemuinotification & cts

Change-Id: I7fd1f2dc06148927e9a4bd5b760d436e2c5e8a98
2017-01-24 08:43:38 -05:00