Commit Graph

16361 Commits

Author SHA1 Message Date
Pavel Grafov
76621cf279 Merge "Password constraints cleanup." 2019-10-16 17:49:12 +00:00
Pavel Grafov
6f334843a8 Password constraints cleanup.
1. PasswordMetrics now doesn't have 'quality', it is only used inside DPMS.
   This allows easier and unambiguous comparisons.
2. Password complexity code reworked.

Future work: factor validation code into a android.app.PasswordPolicy class
to make PasswordMetrics just represent metrics. It is still used in two ways:
specifying an actual metrics and specifying a minimum metrics for comparison,
this will be addressed later.

Test: atest com.android.cts.devicepolicy.PasswordComplexityTest
Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testResetPasswordWithToken
Test: atest FrameworksCoreTests:PasswordMetricsTest
Test: atest FrameworksCoreTests:PasswordPolicyTest
Test: atest com.android.cts.devicepolicy.ManagedProfilePasswordTest
Bug: 138375712
Change-Id: I8ad55f373712ac1dc8343f8cbae23ebb1efe78b9
2019-10-16 16:10:36 +01:00
TreeHugger Robot
d9294a0a43 Merge "unhide getConsolidatedNotificationPolicy" 2019-10-16 05:10:10 +00:00
TreeHugger Robot
6b905bca2f Merge "Explicitly take flags in createContextAsUser()" 2019-10-15 04:11:04 +00:00
TreeHugger Robot
dead70a0a0 Merge "Lock on ResourcesManager when cleaning references" 2019-10-14 23:01:58 +00:00
TreeHugger Robot
9011d90f6b Merge "fix the issue slice cannot be triggered from uri" 2019-10-14 22:18:27 +00:00
Neil Fuller
2505d7580c Merge "Make TimestampedValue Parcelable" am: 81a705690b am: 209c74f8b6 am: 4055cdd965
am: bfe51f8b64

Change-Id: Ied15954c16a1661db7b0d379e1ca71fa7e2c5694
2019-10-14 12:03:18 -07:00
Neil Fuller
bfe51f8b64 Merge "Make TimestampedValue Parcelable" am: 81a705690b am: 209c74f8b6
am: 4055cdd965

Change-Id: I2e507f9cef730c1032767500d36dc0397499c310
2019-10-14 11:56:20 -07:00
Neil Fuller
4055cdd965 Merge "Make TimestampedValue Parcelable" am: 81a705690b
am: 209c74f8b6

Change-Id: I4d9afe91fdea9c5819e4d3d744ac784304abcd19
2019-10-14 11:49:47 -07:00
Neil Fuller
209c74f8b6 Merge "Make TimestampedValue Parcelable"
am: 81a705690b

Change-Id: I68edcf15ec9bef69a26267d9bf0c036e38ce93d4
2019-10-14 11:43:18 -07:00
Treehugger Robot
81a705690b Merge "Make TimestampedValue Parcelable" 2019-10-14 18:33:43 +00:00
Winson
02c7c4c32f Lock on ResourcesManager when cleaning references
Bug: 142634294

Test: atest FrameworksResourceLoaderTests

Change-Id: Ic31925685f362a30370377843b7899ae72cbf5f5
2019-10-14 11:27:36 -07:00
Makoto Onuki
e5449f0b34 Explicitly take flags in createContextAsUser()
Bug: 142472686
Test: atest android.content.cts.ContextTest#testCreateContextAsUser
Change-Id: Id2e3d5ffe5887a4916e0872a7e85d62cbb439744
2019-10-14 11:09:00 -07:00
Beverly
d994e2e3c3 unhide getConsolidatedNotificationPolicy
Test: atest android.app.cts.NotificationManagerTest#testConsolidatedNotificationPolicy
Test: atest android.app.cts.NotificationManagerTest#testConsolidatedNotificationPolicyMultiRules
Bug: 141767508
Change-Id: Ie13223760d1434d8a277ffe99e7e8e07718ae639
2019-10-14 11:26:43 -04:00
Rubin Xu
9af061c608 Merge "Introduce LockscreenCredential" 2019-10-14 13:45:14 +00:00
Chen Xu
176dd6b7aa Merge "add a new telephony protection level" 2019-10-12 05:58:56 +00:00
Pinyao Ting
09b91e6027 fix the issue slice cannot be triggered from uri
Bug: 122879432
Change-Id: Id36a45bbbdb858b5b8d9fd6f1b3f5f97eb84e9fd
Test: Manual
2019-10-11 17:04:08 -07:00
Chen Xu
45c183d201 add a new telephony protection level
for oems which take telephony mainline module, all telephony related
apks will be signed with non-platform certificate. that said apks won't
be able to grant platform signature permission. Solution is to add a new
telephony protection level.

Bug: 141479803
Test: cts & manual
Change-Id: Ib3be016080d42fd76e7c131f4e44d815ce431e6e
2019-10-11 13:46:01 -07:00
Winson Chiu
8e4f087cc1 Merge "Add ResourceLoader API with .apk and .arsc support" 2019-10-11 18:05:00 +00:00
Issei Suzuki
b4b372550e Merge "Removed dead code around TRANSIT_TASK_IN_PLACE" 2019-10-11 12:16:41 +00:00
Mady Mellor
11bab7ba60 Merge "Remove embedded & document launch always restrictions from a bubble" 2019-10-10 23:10:36 +00:00
Winson
9947f1e4fa Add ResourceLoader API with .apk and .arsc support
ResourceLoaders allow inserting another .apk/.arsc into AssetManager's
resource resolution search. The effect is similar to overlays,
where a entry of >= config later in the path list will return that
ApkAsset's resource value instead.

Because loading from an .arsc is supported, which doesn't contain
any actual files, ResourceLoader exposes loadDrawable and
loadXmlResourceParser to allow an application load those files from
anywhere or create them in code.

The data being loaded is either pushed into an .apk or .arsc that
mocks itself as the package being "overlaid" and is passed in
through ResourcesProvider, an interface with static methods that
supports loading from a readable path on disk or a FileDescriptor.

The APIs are accessed through a Context's getResources(), which
has been changed to be unique per "Context-scope", which is usually
the lifetime of the Java object. The exception is that Activities
who get their Resources object persisted across recreations
maintain that logic for persisting ResourceLoaders.

Bug: 135270223

Test: atest FrameworksResourceLoaderTests

Change-Id: I6929f0828629ad39a21fa155e7fec73bd75eec7d
2019-10-10 15:41:03 -07:00
Makoto Onuki
701edd6c0c Merge "Add Context.createContextAsUser()" 2019-10-10 18:52:49 +00:00
Makoto Onuki
b844001d6a Add Context.createContextAsUser()
Without it, apps (mainline modules) will need to use createPackageContext...,
which is a bit painful.

Bug: 142472686
Test: atest android.content.cts.ContextTest#testCreateContextAsUser
Change-Id: Id640e03862462724df1a4a3101f0b08faafba22f
2019-10-10 15:58:20 +00:00
Issei Suzuki
d196637f9f Removed dead code around TRANSIT_TASK_IN_PLACE
Test: All existing tests still pass.
Change-Id: I881677c3a1737e4d0eca0a651216679819584179
2019-10-10 15:13:33 +02:00
Neil Fuller
def77b5cd5 Make TimestampedValue Parcelable
Make TimestampedValue Parcelable for simplicity.

TimetampedValue objects are not generally parcelable, depending on the
type of the value held. Previously, TimestampedValue did not implement
Parcelable to avoid committing to a general contract. Developers
parceling TimestampedValue objects were expected to call
TimestampedValue.writeToParcel() / TimestampedValue.readFromParcel()
explicitly when they knew it was safe to do so. This also meant that
TimestampedValues couldn't be used directly via AIDL.

This change makes TimestampedValue parcelable because it's more
familiar / convenient. Attempts to marshall a TimestampedValue that
contains a non-parcelable value will still throw a RuntimeException.

Bug: 140712361
Test: atest android.util.TimestampedValueTest
Change-Id: I8ca9c72f0433b380ce720cd813f650e743b3ddae
2019-10-10 10:16:41 +01:00
Alex Light
cfdc4f7686 Merge "Perform agent startup-attach before bind" am: 7ae1299cdd am: d3337c9051 am: b49226d0be
am: a10ebfaa56

Change-Id: I3bc2422269baebdfe9a9a8aa2894b12c4dfe5586
2019-10-09 15:26:37 -07:00
Alex Light
a10ebfaa56 Merge "Perform agent startup-attach before bind" am: 7ae1299cdd am: d3337c9051
am: b49226d0be

Change-Id: I7ef1a8d56ebe123e19f2913c13324bd52ac08de2
2019-10-09 15:14:51 -07:00
Alex Light
b49226d0be Merge "Perform agent startup-attach before bind" am: 7ae1299cdd
am: d3337c9051

Change-Id: I1a23e449d95ddc61aafcb3746bc79f6b734ddbef
2019-10-09 14:58:09 -07:00
Alex Light
d3337c9051 Merge "Perform agent startup-attach before bind"
am: 7ae1299cdd

Change-Id: I9fc9f0daa019ce8110154d8ede8f269b7d3bfea9
2019-10-09 14:42:15 -07:00
Alex Light
7ae1299cdd Merge "Perform agent startup-attach before bind" 2019-10-09 21:25:48 +00:00
Chris Tate
9d23418063 Merge "Move PackageManagerInternal to services.jar" 2019-10-09 17:51:10 +00:00
Varun Shah
b5ceeaf629 Merge "Allow the supervision app to access certain UsageStats APIs." 2019-10-09 03:24:13 +00:00
Christopher Tate
e4f5f2d3f5 Move PackageManagerInternal to services.jar
The one messy internal caller is the settings provider, so a new @hide
API on PackageManager was introduced to decouple the provider from
LocalServices.  That new entry point is only callable by uid 1000,
paralleling the previous system-caller-only availability.

Bug: 140833849
Test: system boots & runs normally
Change-Id: I93ae38b8f55db7864893a97795aea63014bf5e12
2019-10-08 15:49:43 -07:00
Varun Shah
b472b8f281 Allow the supervision app to access certain UsageStats APIs.
Allow the active supervision component to access app usage limit APIs.
This includes #registerAppUsageLimitObserver
and #unregisterAppUsageLimitObserver.

Bug: 138681869
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest#testIsActiveSupervisor
Test: atest AppTimeLimitControllerTests
Test: atest android.app.usage.cts.UsageStatsTest
Change-Id: I3daafc14ccdbf27558c1325b965f2bc6d2dab2f6
2019-10-08 11:45:38 -07:00
Alex Light
2d0691c7e1 Perform agent startup-attach before bind
We were performing agent startup-attach during bind but this was too
late for some agents, as it occurred after Context was created. Change
implementation to make this occur prior to bind.

Test: atest CtsJvmtiAttachingHostTestCases
Bug: 142010970
Change-Id: I5f75e8b3c508116762b7863d9b47251d0e808ea9
2019-10-08 11:09:53 -07:00
Rubin Xu
a58125d2a4 Introduce LockscreenCredential
* Wrap credential bytes and type into one single object.

* Update all external APIs dealing with lockscreen passoword
  to use the LockscreenCredential class. Remove existing variants
  that handles pin/password/pattern separately.

* Coerce password quality passed to LockSettingsService into one
  of UNSPECIFIED, PATTERN, NUMERIC or ALPHABETIC (explained below).

* Update all clients & tests to interface with LockscreenCredential.

Note: LockscreenCredential distinguishes between PIN and password
in its public interfaces, this is to pave the way for the next
patch of formally introducing a CREDENTIAL_TYPE_PIN type and
getting rid of the requestedQuality being passed along (whose
sole purpose nowadays is to distinguish between PIN and password)
For now LockscreenCredential still uses the quality value internally
to make that distinction. This does result in a change to what
quality values LockSettingsService receives as part of credential
change: after this CL LSS will only see the quality being
one of UNSPECIFIED, PATTERN, NUMERIC or ALPHABETIC, while it used to
receive other qualities (NUMERIC_COMPLEX, ALPHANUMERIC etc) if device
admin sets a password policy. This shouldn't make any behaviour changes
though, because the new range of values is still sufficient to
distinguish between PIN/Pattern/Password, which is what the consumers
of the stored quality care about.

Bug: 65239740
Test: atest com.android.server.locksettings
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Test: atest com.android.internal.widget.LockPatternUtilsTest
Test: atest com.android.internal.widget.LockscreenCredentialTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.password
Test: atest MixedManagedProfileOwnerTest#testResetPasswordWithToken
Test: atest MixedDeviceOwnerTest#testResetPasswordWithToken
Test: manually set an PIN/Pattern/Password; then change to
      PIN/Pattern/Password; finally remove password
Test: manually create a work profile; try unify and ununify work
      challenge.
Test: manually test lockscreen FRP flow (change password via Settings /
DPC)
Change-Id: I04cc04057c96292a7b1b672bff2a09d594ea9b3c
2019-10-08 17:29:47 +01:00
TreeHugger Robot
6457e8447b Merge "Add callback to notify frozen RecentTasks" 2019-10-07 23:59:32 +00:00
Vinit Nayak
8e54796add Add callback to notify frozen RecentTasks
TaskStackListener can now know when
RecentTasks recents list has been
frozen and unfrozen.
Launcher needs this to know when to listen
for multiple swipe regions in quickstep
for apps with different orientations.

Fixes: 140116135
Test: Had Launcher be a consumer of new
listener and verified via logs and
debugger that it was sending the correct
callback when quickswitching apps.

Change-Id: I65fb92d2490c91837523b99563d4fef422dabb76
2019-10-07 15:01:01 -07:00
TreeHugger Robot
8e73c69e91 Merge "Add KeyChain.KEY_ALIAS_SELECTION_DENIED constant." 2019-10-07 14:57:42 +00:00
Polina Bondarenko
a75bf0ca59 Add KeyChain.KEY_ALIAS_SELECTION_DENIED constant.
Add KEY_ALIAS_SELECTION_DENIED contant to flag that no private key alias has
been chosen in onChoosePrivateKeyAlias, but no KeyChainActivity selection dialog
should be presented to the user.

Bug: 136649900
Test: run cts --test MixedManagedProfileOwnerTest#testDelegationCertSelection
Change-Id: I9aeea7be0c2a6172ca054f91d49183c843ecfa6e
2019-10-07 15:05:39 +02:00
Kevin Chyn
f8ff281ae0 Merge changes from topic "biometric-ui-credentials"
* changes:
  Animate panel to transparent if profile is managed
  17/n: Show credential UI if setDeviceCredentialAllowed(true) and no biometrics
  16/n: Add PIN/Password
  15/n: Allow Auth UI to start in credential UI
  14/n: Animate to device credential UI when lockout occurs
  13/n: persist device credential across configuration changes
  12/n: Add LockPatternView for setDeviceCredentialAllowed(true)
  11/n: Animate panel to full-screen when "Use Password" is pressed
  Removing old confirm device credential logic
2019-10-05 02:37:26 +00:00
Jacky Kao
61178c5f13 Merge "Implementing new API : getWindowsOnAllDisplays()" 2019-10-05 00:07:04 +00:00
TreeHugger Robot
f25b446cae Merge "Add Resources Perf Tests" 2019-10-04 21:54:30 +00:00
Makoto Onuki
496d47ab03 Merge "MoveAppStandbyController to the jobscheduler module" 2019-10-04 17:01:41 +00:00
Makoto Onuki
ec55b7a13d Merge "Clean up SystemServiceRegistry." 2019-10-04 17:01:22 +00:00
Jacky Kao
c7be7b52a2 Implementing new API : getWindowsOnAllDisplays()
1. Implementing the new API for supporting multi-display.
SparseArray<List<AccessibilityWindowInfo>> getWindowsOnAllDisplays()
2. Modifying the documents of this API and its function is to get the window lists of
default display.
List<AccessibilityWindowInfo> getWindows()

Bug: 133279356
Test: a11y CTS & unit tests
Change-Id: Id4e874f43390bdf4196d106a44bbca18bf9fd1d6
2019-10-04 08:31:14 +08:00
Makoto Onuki
a72e04fcd9 MoveAppStandbyController to the jobscheduler module
Bug: 137763703
Test: boot
Test: atest AppStandbyControllerTests
Change-Id: I03799c976f6c8b3e775a1a6321885a9cb069a0a0
2019-10-03 15:41:26 -07:00
Mady Mellor
c41ed32b60 Remove embedded & document launch always restrictions from a bubble
* No longer need the embedded flag as of ag/9341444
* Instead of requiring the app to specify documentLaunchMode=always we'll
  apply the relevant intent flags to force that behaviour
* Adds a new param to include a "fillInIntent" which can adjust the
  flags on the PendingIntent.

Bug: 138325285
Test: manual with BubblesTest (removed the flags in the test app, things
      should still bubble)
Test: atest NotificationManagerTest (needs CTS CL)
Change-Id: I08de491fc89d8182f2b2a7df95c985d8be847aab
2019-10-03 15:01:28 -07:00
Chen Xu
d6b2673181 remove API RoleManager.getFinancialSms
getFinancialSms is not functional and not used today, thus
remove it to avoid future confusion

Bug: 138745655
Bug: 140908357
Test: atest android.telephony.cts.SmsManagerTest
Change-Id: Ib57d0fc189b6c894227894ee02b592f7ee46f22f
2019-10-03 14:37:53 -07:00