Commit Graph

1033 Commits

Author SHA1 Message Date
TreeHugger Robot
071072f33e Merge "Implement Luhn checksum algo" 2017-07-12 01:06:55 +00:00
Philip P. Moltmann
4e5ce39039 Implement Luhn checksum algo
Ignore all non-digits. If only digits should be allowed, the
developer can use a combination of SimpleRegexValidator and
RequiredValidators.

Bug: 62534917
Test: cts-tradefed run cts-dev -m CtsAutoFillServiceTestCases
          --test=android.autofillservice.cts.LuhnChecksumValidatorTest

Change-Id: I4a7c68a236c3d4cb967f1bc61115df89e584a86d
2017-07-11 09:19:31 -07:00
Philip P. Moltmann
2a9a771c65 Stabilize order of options in ImageTransformation
If two options match a the one added first is picked instead of a random
one.

Test: cts-tradefed run cts-dev -m CtsAutoFillServiceTestCases
           --test=android.autofillservice.cts.ImageTransformationTest

Change-Id: I17d6b93d406fe6aa70646dd0432091aab0ce55c0
2017-07-11 08:07:27 -07:00
TreeHugger Robot
99f0e0ef1e Merge "Verify regex on ImageTransformation" 2017-07-11 01:40:09 +00:00
Philip P. Moltmann
de78fabb74 Verify regex on ImageTransformation
Also change the constructor of the Builder of this class

Bug: 62534917
Test: cts-tradefed run cts-dev -m CtsAutoFillServiceTestCases
Change-Id: Ie54f3a1d4b3a0ecd25945d3deafb4858423f926e
2017-07-10 16:54:52 -07:00
Philip P. Moltmann
ebbe2d4899 Verify regex on CharSequenceTransformation
... Also
- change the constructor of the Builder of this class
- Do not crash if the subsitutions for the regexes are invalid

Change-Id: I965d5830f4932eb40ec22d7fa308815955920a99
Bug: 62534917
Test: cts-tradefed run cts-dev -m CtsAutoFillServiceTestCases
2017-07-10 15:15:48 -07:00
TreeHugger Robot
de295549d1 Merge "Hide some systemapi methods" 2017-07-10 17:59:36 +00:00
Julia Reynolds
7ca33079fd Hide some systemapi methods
Test: make
Change-Id: I0234ca06f68f0a25e1923e171cb6ef19d848aecd
Fixes: 62342239
Fixes: 62264035
2017-07-05 09:17:49 -04:00
Andrew Scull
0e5d5b1c8c PDBS: add package check for getMaximumDataBlockSize()
This method is only useful to the package that writes data to the block
so this applies the same security check as the write() method.

getDataBlockSize()'s security check was only relaxed to use a permission
as it is used by other system apps to determine whether the block
contains data and hence is in use (see ag/593371).

Fix: 62348164
Test: add a Google account to the device causing gmscore to call the
method
Change-Id: I7e71ea236899bf2e4df7cb26ae285b414e9e6565
2017-06-30 15:37:03 +01:00
TreeHugger Robot
ee39d54a8d Merge "Initial implementation of the new Save APIs." 2017-06-29 02:43:36 +00:00
Felipe Leme
979013d027 Initial implementation of the new Save APIs.
Test: manual verification with sample app (CTS tests coming later)

Bug: 62534917

Change-Id: I085a9c933bb5e8316d673976e059e13abd7098e5
2017-06-28 15:13:21 -07:00
Jeff Davidson
7b69a86b02 Add EuiccManager#retainSubscriptionsOnFactoryReset API.
By default, all subscriptions are wiped on first boot after a factory
reset. This ensures that if data is wiped outside of userspace (e.g.
in fastboot/recovery), the profiles are wiped, as there's no way to
offer this option to users in those modes - the radio isn't available
for us to access the eUICC.

This API provides a way to bypass this wipe if the user opts to retain
the policies for a wipe done from userspace (e.g. by unchecking the
"Wipe eUICC" checkbox in platform settings before wiping). We tell the
LPA to note this and skip the wipe on the ensuing factory reset.

Change-Id: I2fe472417497e28b043841a5aa2dc9efa45ebbff
Test: TreeHugger
Fixes: 62681577
2017-06-27 09:23:07 -07:00
TreeHugger Robot
776220d029 Merge "Pass calling package to resolution UI." into oc-dr1-dev 2017-06-27 00:48:39 +00:00
Felipe Leme
91d763f1b5 Improved documentation for AutofillService package:
am: 2ef19c1d73

Change-Id: I67d6649d4acb84ebb598c1ebceb3c3ed58cfd0c0
2017-06-23 00:36:35 +00:00
Felipe Leme
2ef19c1d73 Improved documentation for AutofillService package:
- Moved (and expanded) overall documentation from FillResponse to
  AutofillService.
- Improved SaveInfo documentation.
- Improved FillRequest documentation.
- Improved Dataset documentation.

Bug: 37567048
Test: ran 'm -j doc-comment-check-docs' and checked resulting HTML

Change-Id: I157893deac06a5ed5e1cb7fd082da485f227b9ee
2017-06-22 15:25:31 -07:00
Felipe Leme
a4d103d480 Merge changes from topics 'bug_62802026_take_2', 'bug_62802026' into oc-dev
am: 4f7fd183eb

Change-Id: Ibd7aebe46d1bb419ca33f8f38999fa9ab0d981ff
2017-06-21 04:02:27 +00:00
Felipe Leme
9cd1c52867 Fixed how FillEventHistory is reset and clarified javadoc.
am: 2e30c6f371

Change-Id: I55eb6f4a11e28ef2a8171c62848eb2b067f05ba1
2017-06-21 04:00:27 +00:00
TreeHugger Robot
4f7fd183eb Merge changes from topics 'bug_62802026_take_2', 'bug_62802026' into oc-dev
* changes:
  Don't add FillEventHistory events to the wrong session.
  Fixed how FillEventHistory is reset and clarified javadoc.
2017-06-21 03:45:50 +00:00
Felipe Leme
d013bcea97 Don't add FillEventHistory events to the wrong session.
The AutofillSession.getFillEventHistory() method returns only the event history
for the last onFillRequest(). In the scenario where the user switches
activities and the server has multiple sessions open, only the events for the
last session should be recorded.

Test: existing CtsAutoFillServiceTestCases pass
Test: LoginActivityTest.checkFillSelectionFromPreviousSessionIsDiscarded

Fixes: 62802026

Change-Id: I447ed77c2167095867b35d616b5cf2ae43aa28db
2017-06-20 17:31:20 -07:00
Felipe Leme
284ec6eec7 Merge "Removed deprecated, hidden method." into oc-dev
am: 17efecf48f

Change-Id: Id79feb953db68214e848e9bb3f8f3aaec6d56824
2017-06-20 22:43:23 +00:00
Felipe Leme
2e30c6f371 Fixed how FillEventHistory is reset and clarified javadoc.
Test: existing CtsAutoFillServiceTestCases pass
Test: checkFillSelectionIsResetAfterReturningNull()
Test: checkFillSelectionIsResetAfterReturningError()
Test: checkFillSelectionIsResetAfterTimeout()

Bug: 62802026

Change-Id: I389d95fc13c08f1056960e5f67e131c8dc306401
2017-06-20 14:54:05 -07:00
Felipe Leme
bce4b7f127 Removed deprecated, hidden method.
Test: existing CtsAutoFillServiceTestCases pass
Bug: 37563972

Change-Id: I10c5a2b16b422694d72b3ccaf6629d50247c7f49
2017-06-20 10:21:41 -07:00
Felipe Leme
51ed7f4e6b Merge "Fixed updateAutofillValue() when mText is not set." into oc-dev
am: 4eaba84065

Change-Id: I7603a791f8c149799a0adf9e0fe735483ce1be1a
2017-06-20 00:36:12 +00:00
Felipe Leme
266752317b Fixed updateAutofillValue() when mText is not set.
updateAutofillValue() was crashing some apps when the mText was not set at the
time it was called. One solution would be to not set mText at all - since the
Autofill Service should rely only on getAutofillValue() - but that could break
existing services.

Hence, a safer solution is to set that field if it's null.

Test: existing CtsAutoFillServiceTestCases tests pass
Test: manual verification using Fly Delta app

Fixes: 62751039

Change-Id: I91a8e0ed5db4148f5eb5729b8e254aa3531f15e4
2017-06-19 11:43:33 -07:00
Felipe Leme
1c5cb925b8 Merge "Use an optimized findViewNodeByAutofillId(id) to get just one node." into oc-dev
am: a89414962d

Change-Id: I70d76618c929bdfeee715909c70a678fbc5f4a3e
2017-06-16 21:59:55 +00:00
TreeHugger Robot
a89414962d Merge "Use an optimized findViewNodeByAutofillId(id) to get just one node." into oc-dev 2017-06-16 21:45:46 +00:00
Jeff Davidson
79c7a85d60 Merge "Allow EuiccService IPCs to happen in parallel." into oc-dr1-dev 2017-06-16 20:50:09 +00:00
TreeHugger Robot
04d2ec59e8 Merge "WallpaperColors refactor" into oc-dr1-dev 2017-06-16 20:05:03 +00:00
Felipe Leme
bc8386db5b Merge "Throw IAE when service add null AutofillIds on SaveInfo methods." into oc-dev
am: 6cde68752c

Change-Id: I9efd96bcd649bd23db28136aa4afca16a677e9ea
2017-06-16 19:34:01 +00:00
Felipe Leme
94b56207a4 Use an optimized findViewNodeByAutofillId(id) to get just one node.
Session was using findViewNodesByAutofillIds(ids) before, which not only was
not optimal, but error prone (for example, it could return a non-empty array
with an empty value).

Test: CtsAutoFillServiceTestCases pass
Fixes: 62532979

Change-Id: If984f1263cc3f2aac1d1e098687fe02d73c55211
2017-06-16 11:51:49 -07:00
Lucas Dupin
84b89d9d59 WallpaperColors refactor
Hiding color extraction into WallpaperColors.
This enables us to create WallpaperColors from a a Bitmap
or Drawable.

Fixes: 62197187
Fixes: 62490115
Test: runtest --path cts/tests/app/src/android/app/cts/WallpaperColorsTest.java
Change-Id: I614cfa205e02b551a141642eac6de21251c3bff6
2017-06-16 09:27:43 -07:00
TreeHugger Robot
1133cf2b8a Merge "Hide WallpaperService.Engine colors API." into oc-dr1-dev 2017-06-16 04:43:23 +00:00
Jeff Davidson
b4c67ec3c8 Pass calling package to resolution UI.
The calling package is important for the UI to be able to tell the
user who is asking to perform the operation which needs consent. For
example, it should be able to tell the user which carrier app is
asking to download a profile.

Bug: 38049463
Test: TreeHugger + E2E verification
Change-Id: I890f811405cb05672e1271f092ddca60501e7ddc
2017-06-16 02:40:40 +00:00
Felipe Leme
18d0ef70b0 Throw IAE when service add null AutofillIds on SaveInfo methods.
Test: existing CtsAutoFillServiceTestCases pass
Test: manual verification using Contacts app
Test: manual verification adding a CTS test case that crashes the app, but such
      test cannot be commit because once the issue is fixed, it crashes the
      service (the right way to test this fix is through unit tests against
      exceptional conditions, but we don't support those on Autofill yet).

Fixes: 62649290

Change-Id: I8fc01fa929270219cd40035ff02eaf0dda5ecbfa
2017-06-15 16:33:52 -07:00
Jeff Davidson
707c372f09 Allow EuiccService IPCs to happen in parallel.
The (currently) undocumented behavior of oneway AIDLs is to serialize
IPCs made from the same client IBinder object. This is undesirable in
EuiccService as we want to respond to short-lived calls (like listing
subscriptions or getting the EID) while long-lived calls (like
download) are in progress. Introduce our own thread pool to work
around this behavior.

This also fixes a bug where uncaught exceptions thrown in the
implementation of an EuiccService method would be logged but never
trigger a callback on the client. Such exceptions now correctly crash
the app and trigger error callbacks in any active callers.

Bug: 62535655
Test: TreeHugger + verified subscription list during a download
Change-Id: I8b75af7fdc72117a163d81f7bf1447f6cc12ec6d
2017-06-15 11:42:36 -07:00
Lucas Dupin
2b0dab0da7 Hide WallpaperService.Engine colors API.
All apps that need it are bundled in DR.
We need to unhide it for MR1.

Test: make
Bug: 62490115
Change-Id: I58d0a020ec7b1af8cb2659d6957de4bf4d4fa596
2017-06-14 18:30:51 -07:00
Jeff Davidson
83f8bc81be eUICC API error code cleanup.
-Remove result classes in cases that a simple int will do. Split the
int error code space (now shared across all calls) into two parts -
predefined errors (0 or negative) and custom errors (positive).

-Replace "generic error" with "error" in naming.

-Remove detailed code from any result returned by the LPA. There is
still a detailed code in the platform API, which is equal to the
result code returned by the LPA.

Fixes: 38206601
Test: TreeHugger
Change-Id: I304081db2127a22d6dd67b6494b4f3279614d19c
2017-06-13 17:51:07 +00:00
Felipe Leme
5148d9fe81 Merge "Removed deprecated setExtras() method." into oc-dev
am: 7c41ddb975

Change-Id: Id74b4becd0f26d185cad3ecbe539aaa69f7ac89e
2017-06-12 19:05:34 +00:00
Felipe Leme
d52611258e Removed deprecated setExtras() method.
Bug: 37563972
Test: CtsAutoFillServiceTestCases pass

Change-Id: I7fef7c81267dad9097c711dbba849adf9d6b1cc5
2017-06-09 16:19:58 -07:00
Felipe Leme
f9a9bbf430 Merge "Use initial value on save when value didn't change." into oc-dev am: 2e723982d5
am: 08365011a2

Change-Id: I38b2e8096b7fe43a294afe400af093b49616335d
2017-06-07 00:57:16 +00:00
Felipe Leme
2e723982d5 Merge "Use initial value on save when value didn't change." into oc-dev 2017-06-07 00:25:11 +00:00
Felipe Leme
e8f6808079 Use initial value on save when value didn't change.
Otherwise, it will fail to call onSaveRequest() in scenarios where the service
required a field that was pre-populated for the app. For example, when the
service requires both a username and password, the app pre-populates the
username, and the user fills the password.

Test: new LoginActivityTest.testSaveOnlyTwoRequiredFieldsOnePrefilled() pass
Test: existing CtsAutoFillServiceTestCases pass

Bug: 62270740

Change-Id: Idbb11a8c2dab6741c18549c55dfdb71b483c2447
2017-06-06 13:49:42 -07:00
Jeff Sharkey
ec68b46bc8 Merge "Annotate @SystemApi with required permissions." into oc-dev am: c1406978a4
am: 7a2e4a8486

Change-Id: Ib629e25dbf047c110feaf03e4ff744b5c6df9aeb
2017-06-06 15:48:24 +00:00
Jeff Sharkey
d86b8fea43 Annotate @SystemApi with required permissions.
Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.

Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
2017-06-05 13:27:11 -06:00
Chris Wren
5a406e996c Merge "add channel and group tags to the notificaiton logs" into oc-dev am: 76e76a5c26
am: 6b88afda65

Change-Id: I840c89e34b00cf505e50897bc7ba433f37a67dff
2017-06-02 22:51:15 +00:00
Chris Wren
b39217972e add channel and group tags to the notificaiton logs
Change-Id: Icf029e42fca46262c9d9f8ff63f26de098f888bf
Fixes: 37714086
Test: runtest systemui-notification
2017-06-02 16:19:13 -04:00
Winson Chung
a9861756b5 Merge "Prevent showing voice session when it is already queued to be hidden." into oc-dev am: c672cb5ed9
am: 6d9ea8ec97

Change-Id: I9c0768835c6932c3ec4c55a26fdd63b0d5e6bac5
2017-06-02 16:25:07 +00:00
Winson Chung
fc3ec4c5e6 Prevent showing voice session when it is already queued to be hidden.
- It is possible for the session to be requested to be hidden before it
  gets the message to be shown and completes showing. This leads to an
  inconsistency where the voice interaction service implementation will be
  in a different state than the system for the session. Instead, we can
  cancel any pending show messages, and also clean up the pending show
  callback list immediately when the session is hidden.
- Also fixing up some error message codes when starting the assistant
  activity.

Bug: 38379130
Test: android.server.cts.ActivityManagerAssistantStackTests
Test: CtsVoiceInteractionTestCases
Test: CtsAlarmClockTestCases
Change-Id: I0d0e9c024367a47bda82d6a29ca89e18b7d69527
2017-06-01 22:58:01 +00:00
Adrian Roos
7374d3a4bc Credential FRP: Add implementation
- Adds a facility to store a credential handle that survives factory reset
- Adds a method to KeyguardManager for verifying the stored credential for SetupWizard
- Dark launches persisting the primary user's credential as the FRP credential (behind a default-off flag)

Future work:
- Use a separate GK handle / synthetic password for the FRP credential
- Enroll the FRP credential in verifyCredential for the upgrade case

Bug: 36814845
Test: runtest -x core/tests/coretests/src/com/android/internal/widget/LockPatternUtilsTest.java && runtest -x services/tests/servicestests/src/com/android/server/LockSettingsStorageTests.java && runtest -x services/tests/servicestests/src/com/android/server/SyntheticPasswordTests.java
Change-Id: Ia739408c5ecb169e5f09670cd9ceaa7febc2b1cc
2017-05-30 19:14:01 -07:00
Jeff Davidson
91c3d07fd9 Implement remaining core eUICC APIs.
Includes:

-getDefaultDownloadableSubscriptionList, which returns a list of
default subscriptions available for the device.
-getEuiccInfo, which returns an EuiccInfo object containing
non-sensitive information about the eUICC device.
-deleteSubscription, to delete a subscription.
-switchToSubscription, to switch to (or away from) a subscription.
-updateSubscriptionNickname, to update the nickname of a subscription
which is saved to the eUICC.
-eraseSubscriptions, to factory reset the eUICC.
-Settings.Global#DEFAULT_SM_DP_PLUS, a default SM-DP+ server which is
used to query for default subscriptions in
getDefaultDownloadableSubscriptionList.

These APIs follow the template of the APIs which have already been
implemented.

This completes the baseline implementation as designed; any additional
APIs or tweaks to the APIs will be tracked as separate bugs.

Fixes: 33075886
Test: Build/boot
Change-Id: I8057757c874f94e0c816af1ca071d656c8f145b9
2017-05-14 10:57:00 -07:00