Commit Graph

19509 Commits

Author SHA1 Message Date
Kohsuke Yatoh
ef091d3ff7 Merge "Prepare switching font loading to system server." 2020-12-02 07:14:27 +00:00
Kohsuke Yatoh
b11b963ed1 Prepare switching font loading to system server.
Currently, fonts are loaded in Zygote.
This CL adds a preparation to switch it to system server and
bindApplication(), so that system server will be able to update font map
at runtime.

(1) Zygote will be initialized without fonts.
(2) System server will maintain a serialized font map in ashmem.
(3) Apps will load font map from the ashmem in bindApplication().

The change is guarded by Typeface.ENABLE_LAZY_TYPEFACE_INITIALIZATION,
and the new behavior is disabled by default.
I tested with ENABLE_LAZY_TYPEFACE_INITIALIZATION = true.

Bug: 172891184
Test: atest FrameworksCoreTests:TypefaceTest
Test: atest CtsGraphicsTestCases
Test: atest CtsTextTestCases
Test: atest CtsWidgetTestCases
Change-Id: I40832962a4b27f6160c4dc6268689c52f6a4dd33
2020-12-01 16:05:33 -08:00
Alex Johnston
3e36d7cb8b Merge "Add credential management app access control DPM" 2020-12-01 22:29:47 +00:00
TreeHugger Robot
e2cb02d5e8 Merge "AppOp modes ain't flags" 2020-12-01 21:58:46 +00:00
Sunny Goyal
648d4e5e00 Merge "Fixing support for shared element transitions from a window" 2020-12-01 21:19:16 +00:00
TreeHugger Robot
1303f11c5e Merge "Added support to more @DevicePolicyOperation operations." 2020-12-01 21:15:45 +00:00
Alex Johnston
dfdbd2e905 Add credential management app access control DPM
Background
* This is part of the work to support
  a credential management app on
  unmanaged devices.

Changes
* Add isCredentialManagementApp access
  control check to the following DPM API
  methods:
   - installKeyPair
   - removeKeyPair
   - generateKeyPair
   - setKeyPairCertificate

Bug: 165641221
Test: Manual testing with TestDPC
Change-Id: Ib88f077ee1f26c08e648ab8b4bb3544b42078d57
2020-12-01 20:25:33 +00:00
Flavio Fiszman
c36d7b0fb4 Merge "Substitute ShortcutInfo for PeopleSpaceTile." 2020-12-01 20:10:06 +00:00
Philip P. Moltmann
e0241424fe AppOp modes ain't flags
hence, remove incorrect annotation.

Test: built
Fixes: 174237124
Change-Id: Ie90cbd050f32f76bd0b9b01537e39d094352b0d1
2020-12-01 11:52:41 -08:00
TreeHugger Robot
c7a983079f Merge "Make WPMS look for DOs and POs in the correct calling user" 2020-12-01 19:19:13 +00:00
Eran Messeri
613c93b98b Merge "Log setting of password complexity." 2020-12-01 18:38:15 +00:00
Felipe Leme
22f9645b61 Added support to more @DevicePolicyOperation operations.
Also removed wrong permission check on lockNow()- it was only
allowing non-admin apps with the LOCK_NOW permission when the
device doesn't support the feature.

Test: manual verification trying to switch user when car is moving
Bug: 172376923

Change-Id: Icd1bde3a6f27e08c00d8851d16c1a072f7441f32
2020-12-01 10:34:22 -08:00
Flavio Fiszman
e3d7a74db9 Substitute ShortcutInfo for PeopleSpaceTile.
Change-Id: I35570d8ef47822598450e958c1bcbd0d298a1371
Test: Build and run.
2020-12-01 17:14:06 +00:00
Alex Kershaw
5b36ee3f1d Make WPMS look for DOs and POs in the correct calling user
Currently, it will always look in user 0 since it uses the DPM from
mContext, which will always be from user 0 as WPMS is in the system
server process.

Extend DPMI to provide the necessary external helper API. This is
preferable to just using createContextAsUser before getting the DPM
instance since it avoids a second binding.

Fixes: 144048540
Fixes: 172682826
Bug: 153995973
Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testSetWallpaper_disallowed
Change-Id: I52b71000fac31ff6725ddded58206f69b263ae33
2020-12-01 16:26:23 +00:00
TreeHugger Robot
e7080f41df Merge "Add DPM.hasKeyPair()" 2020-12-01 15:28:56 +00:00
Eran Messeri
40431abf25 Log setting of password complexity.
Log a security event when the password complexity is set using the new
setRequiredPasswordComplexity API.

Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest
Bug: 165573442
Change-Id: Ide337ff1f18d1ab0a34bba44004f4bd8b74474c4
2020-12-01 15:27:07 +00:00
Pavel Grafov
b73e15249b Add DPM.hasKeyPair()
The method returns true if a private key and a user certifiate are
present in KeyChain under this alias.

Bug: 160457441
Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testKeyManagement
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegatedCertInstallerDirectly
Test: atest android.admin.cts.DevicePolicyManagerTest
Change-Id: I15ca6190db1ef4dbf0caabe9d46008d92f758df5
2020-12-01 12:57:45 +00:00
Eran Messeri
6aa9b789e4 Merge "DPMS: Enforce password complexity in lockscreen setting" 2020-12-01 09:53:08 +00:00
TreeHugger Robot
2200250bf8 Merge "Promote Context related tests to presubmit" 2020-12-01 07:59:24 +00:00
TreeHugger Robot
e935342b74 Merge changes I682a8054,I71a820a1
* changes:
  Header population cleanup
  Fix NPE that can occur on uiMode change if a group has a single child.
2020-12-01 01:58:02 +00:00
Treehugger Robot
0f662842f8 Merge "Update link for Permissions samples in Javadoc" am: a7564ec175 am: fd9c04868e am: 7078bd5162
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1513929

Change-Id: If7f4fe0469df8d81c97a38b5a9c991e8fad4f02b
2020-12-01 00:06:47 +00:00
Treehugger Robot
7078bd5162 Merge "Update link for Permissions samples in Javadoc" am: a7564ec175 am: fd9c04868e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1513929

Change-Id: I9ca103a83da51c4553b192df6520737cd0936c9b
2020-11-30 23:50:08 +00:00
TreeHugger Robot
8b819c0a03 Merge "Show largeIcon on the left when grouped." 2020-11-30 23:32:06 +00:00
TreeHugger Robot
1f6275fdde Merge "Switch some recent tasks calls from IATM to ATM" 2020-11-30 23:01:21 +00:00
Eran Messeri
9afde363cc DPMS: Enforce password complexity in lockscreen setting
Enforce a lock screen that adheres with the required complexity set by
the admin.

To do this, provide a method to let the Settings code query the
DevicePolicyManager for the effective password complexities that applies
to a user.

Bug: 165573442
Test: Manually, set complexity using TestDPC.
Test: m RunSettingsRoboTests
Change-Id: Ia03aebb725cacc7104d7fd765ae6ab53456e33e0
2020-11-30 22:28:06 +00:00
Jon Miranda
7b5abdcd7d Fixing support for shared element transitions from a window
Previously animation from window always ran in exit mode
causing the animation to play in the calling window surface
instead of the launching activity surface. This causes
flicker on transition end when the rendering switches to
the new activity surface.

Test: Verified with demo app
Change-Id: I07f5aa4e390fd9dab9883894ba7b780170c0e212
2020-11-30 12:54:29 -08:00
Jeff DeCew
6ab1c6488e Header population cleanup
* Show the app name for minimized notifications without titles.
* Don't show the summary separator when the summary text is an empty string.
* Use TextUtils.isEmpty for clarity & add comment.
* Make visibility reset of app_name_text consistent with others.

Bug: 163626038
Test: manual
Change-Id: I682a8054abb80f24044a2a9c204dfadd5e940860
2020-11-30 15:41:36 -05:00
Jeff DeCew
b00728fd4a Show largeIcon on the left when grouped.
* The icon is smaller when shown on the left.
* This only happens when grouping logic hides the notification icon (same icon/color for all children in the group).
* Does not apply to messaging layouts.

Bug: 163626038
Test: manual
Change-Id: I4c7db076db11ccc69f2907bbb441ff3bc06078f2
2020-11-30 15:24:35 -05:00
Garfield Tan
42767054cc Add task visibility to TaskInfo.
Bug: 165794880
Test: Task visibility is pushed to WM shell.
Change-Id: If518a72c658ffe55b60c82afadfc92b1e7bd2738
2020-11-30 11:23:28 -08:00
Tiem Song
eff0b0673c Update link for Permissions samples in Javadoc
Bug: 158042826
Change-Id: I71ab17b21b31ff6584facd023e4c4818b0ab1b55
Test: N/A
2020-11-30 18:17:43 +00:00
Wale Ogunwale
071e95e8af Switch some recent tasks calls from IATM to ATM
The aidl IActivityTaskManager interface doesn't allow for method
overloading with the same name. Switching some of these calls to use
ActivityTaskManager class instead makes it easier to have overloads in
upcoming CLs.

Test: they pass!
Bug: 172776536
Change-Id: Ic4895ccf7dc1207cc6b14004cfcf6ee7b4b76cc1
2020-11-30 06:57:29 -08:00
Almaz Mingaleev
c7a7943a2a Merge "Make manual suggestions synchronous/return result" am: 08466f6151 am: 413f8199da
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1252169

Change-Id: I8d41c4ab3688a5e1cc2a7d2b52d25e52c059c808
2020-11-25 12:18:38 +00:00
Neil Fuller
1395dffdb1 Make manual suggestions synchronous/return result
Modify the suggestManual...() methods on TimeDetector and
TimeZoneDetector to be synchronous, and have them return true/false to
indicate if the call "succeeded". This is being done before adding more
calls that will be used by apps like SettingsUI; generally all calls
that are user facing and could conceivably fail should return
success/failure information and therefore need to happen synchronously.

Test: atest services/tests/servicestests/src/com/android/server/timedetector/
Test: atest services/tests/servicestests/src/com/android/server/timezonedetector/
Bug: 140712361
Merged-In: I5b6b7fb5af2ffe88392b2ca8d1e8fff2a187521b
Change-Id: I5b6b7fb5af2ffe88392b2ca8d1e8fff2a187521b
2020-11-25 09:57:07 +00:00
Rubin Xu
5834f23224 Merge "Remove some getCallerIdentity variants in DevicePolicyManagerService" 2020-11-24 22:17:28 +00:00
Rubin Xu
750185ba76 Remove some getCallerIdentity variants in DevicePolicyManagerService
CallerIdentity object should only wrap around caller-provided and
authenticated (uid, ComponentName, PackageName) tuple. In some
instances the caller does not provide ComponentName or PackageName,
and CallerIdentity should keep track of this instead of trying to
infer the associated ComponentName or PackageName. This is because
there is one-many mapping from uid to package name, so the inference
can be imprecise as well as losing information of what the caller
supplied originally. Instead all the isXX() access control methods
should handle the case that ComponentName or PackageName might
be missing.

Bug: 167960209
Test: atest OrgOwnedProfileOwnerTest
Test: atest MixedDeviceOwnerTest
Test: atest MixedManagedProfileOwnerTest
Test: atest MixedProfileOwnerTest
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Change-Id: I8d2dfeb2e5137ea06f941855d2e5608998a86912
2020-11-24 14:56:17 +00:00
TreeHugger Robot
5f430b6a4a Merge "Empty text treated like null text" 2020-11-24 00:30:06 +00:00
Hui Yu
3357e7f9f4 Merge "BG-FGS-launch restriction exemptions." 2020-11-24 00:26:36 +00:00
Jeff DeCew
4346696937 Empty text treated like null text
This fixes an edge case with my Maps navigation notifications where the vertical alignment was obviously wrong.

Bug: 163626038
Test: manual
Change-Id: Id2d336acca20483e578d0070151065988aea9ea8
2020-11-23 15:23:21 -05:00
TreeHugger Robot
7f98fd5330 Merge "Do not hide app name when title is empty." 2020-11-23 19:49:36 +00:00
Hui Yu
20f42909f8 BG-FGS-launch restriction exemptions.
1. Add a new permission START_FOREGROUND_SERVICES_FROM_BACKGROUND.
2. Add a new bind flag BIND_ALLOW_FOREGROUND_SERVICE_STARTS_FROM_BACKGROUND
3. BroadcastOptions.setTemporaryAppWhitelistDuration() is currently
protected with CHANGE_DEVICE_IDLE_TEMP_WHITELIST permission, also open
it for START_ACTIVITIES_FROM_BACKGROUND and
START_FOREGROUND_SERVICES_FROM_BACKGROUND permission.
4. Exempt SYSTEM_ALERT_WINDOW permission.
5. if Context.startForegroundService() or Service.startForeground() is
restricted by BG-FGS-launch restriction, and app's targetSdkVersion is S
and above, throw a IllegalStateException.

Bug: 171305836
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testFgsBindingFlagFGS
atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testFgsBindingFlagActivity
atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testFgsStartSystemAlertWindow
atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testFgsStartFromBGException

Change-Id: Iff3ed65e174a8406d4d6045cda42bdde6cecf30d
2020-11-23 11:19:59 -08:00
TreeHugger Robot
dfde1bd0f4 Merge "Documented what's returned by DPM.getUserRestrictions()." 2020-11-23 16:58:21 +00:00
Jeff DeCew
32525d92b5 Do not hide app name when title is empty.
This fixes an awkward edge case where apps omit a title because they depend on the app name to contextualize the text in the notification body.

Bug: 163626038
Test: manual
Change-Id: I452bdfcfd956d195aed575ace3b9f0556bc2d6df
2020-11-23 11:44:56 -05:00
Todd Kennedy
569435e0eb Implment get/query APIs for properties
Bug: 169258655
Test: atest CtsContentTestCases:PackageManagerGetPropertyTest
Test: atest CtsContentTestCases:PackageManagerQueryPropertyTest
Change-Id: I91d58cd42e7f1f10b0e494ff9f318a9e3fa073db
2020-11-21 08:12:13 -08:00
Ahaan Ugale
5d69e8ed59 Allow only preloaded voice recognition services to blame calling apps. am: 19e29925ee
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13095463

Change-Id: I48f2f854ee8efc9db99ceaaba28a48888a39f1d7
2020-11-21 13:48:04 +00:00
Ahaan Ugale
19e29925ee Allow only preloaded voice recognition services to blame calling apps.
Bug: 170795434
Test: manual
Merged-In: Ided2b19661d937ff0b4ec881f2e629afe47435e5
Change-Id: I92a146e5763afd07a44f8e9c7a3c71a27d1f16bd
2020-11-21 03:29:40 +00:00
TreeHugger Robot
ea4af47814 Merge changes I8e5fe162,Ic780f98a,I8973907c
* changes:
  Collapsed DecoratedCustomView notifications show app name instead of title.
  Fix snooze/bubble button padding
  Fix Gmail undo state.
2020-11-21 00:44:43 +00:00
TreeHugger Robot
76e3e7682a Merge "Allow preload voice recognition service can blame app." 2020-11-20 22:40:16 +00:00
Ashwini Oruganti
cb5e8c5087 Merge "Update the docs for FLAG_UPDATE_CURRENT and FLAG_IMMUTABLE" 2020-11-20 21:30:14 +00:00
Jeff DeCew
fa5c76c245 Collapsed DecoratedCustomView notifications show app name instead of title.
Previously, we never showed a title in the decorations, and
we still don't in the expanded decorations.  Rather than
making devleopers deal with the discrepancy, it's easier to
just show the app name for these views.  It makes them a
tad less desirable, but we could potentially give developers
a flag to opt into the title in the future.

Bug: 163626038
Bug: 173528244
Bug: 173742646
Test: manual
Change-Id: I8e5fe162c1ccdddcd39ea36f2b28fcc6aefd1f83
2020-11-20 14:39:44 -05:00
Jeff DeCew
4d19b03fd5 Fix Gmail undo state.
We forced all notifications to have an expanded
state, but the Gmail undo notification is totally
broken in that case.  This check exempts an obviosuly
bad expanded state from having to exist, fixing
Gmail's undo flow in the process.

Fixes: 173774694
Bug: 163626038
Bug: 173550917
Test: manual
Change-Id: I8973907ceb06ccf06c0a685fc0f2a2d283794fe5
2020-11-20 14:39:43 -05:00