Commit Graph

19411 Commits

Author SHA1 Message Date
Jeff DeCew
5185c6bf66 Merge changes from topic "template_redesign"
* changes:
  Update variable names to reduce confusion.
  Fix/hack MessagingStyle notifications
  Reduce notification minimized height
  Fix the placement of the work profile and feedback badges.
  Fix HUNs
  Remove the unneeded icon spacing in the InboxStyle.
  Hide app name from minimized notifications
  Notification Title is 16pt in Big state
  Ensure headerless notification with large icon is big enough.
  Round corners of BigPicture
  Increase the expand button touchable area.
  Remove the reply action entirely.
  Notification template redesign; part 1.
  Remove night-mode override of notification_divider_height
2020-11-17 13:21:53 +00:00
TreeHugger Robot
b56d546518 Merge "Add ability to cancel ANR dialogs" 2020-11-17 06:38:53 +00:00
Christopher Tate
f2c18bbbc4 Defer FGS notification display for a few seconds
When a service is transitioned to the foreground state, we defer display
of its associated Notification for a short time, to reduce user
disturbance in situations where the FGS is short-lived.  Apps can force
immediate display when they know it's relevant, and Notifications known
to correspond to contexts in which immediate display is appropriate -
such as media playback - are not deferred.

The behavior can be disabled or the deferral interval adjusted via
DeviceConfig.

Bug: 171499612
Test: ApiDemos
Test: atest CtsAppTestCases:ServiceTest
Test: atest CtsAppTestCases:NotificationManagerTest
Change-Id: I0cae3dc6f943e99873ed8c1687914ad08ec29b57
2020-11-16 14:43:36 -08:00
Charles Chen
e9cf1f9847 Merge "Introduce getWindowContextToken" 2020-11-16 08:47:01 +00:00
Alex Johnston
68334bb539 Merge "add MANAGE_CREDENTIALS appop" 2020-11-16 07:48:18 +00:00
Charles Chen
468a11afdd Introduce getWindowContextToken
Also consolidate UI context related flags to ContextType.

Bug: 171280916
Test: atest ContextTest ContextAccessTest
Test: atest WindowContextTest WindowContextTests \
            WindowMetricsTest WindowMetricsTests
Test atest InputMethodServiceStrictModeTest \
           InputMethodMenuControllerTest
Test atest InputMethodServiceTest#testGetDisplay
           StrictModeTest#testIncorrectContextuse_*

Change-Id: I7f3a7f951c664d4c329059942e688ee3a625b992
2020-11-16 14:19:36 +08:00
Jeff DeCew
6f96b0b7c2 Fix HUNs
* Add and prefer a heads up template which is
  the base template + actions
* When a HUN shows a template with a header,
  only allow hiding that header if there is
  no large icon to avoid a visual mess.

Bug: 163626038
Test: manual
Change-Id: Ia42e0a6b1b1ecd4dd438a817f9442a838a2bdb5c
2020-11-13 13:16:02 -05:00
Jeff DeCew
41cdfc0ae8 Remove the unneeded icon spacing in the InboxStyle.
Because the LargeIcon is was moved up a 'line' to
the top of the notification, the only lines which
can intersect it are the header and title lines;
the first line of text from the inbox style no
longer can.  This also sort of depends on
ag/13018219 which fixed the vertical spacing
enough to make this look good.

Bug: 163626038
Test: manual
Change-Id: Ic9ed82eb3c0e9c7e619917351c3461ffe1713857
2020-11-13 13:16:01 -05:00
Jeff DeCew
b90803f72b Hide app name from minimized notifications
Bug: 163626038
Test: manual
Change-Id: Ic579e2640ad4d2d11bdce856a46e8aa9d00c9c92
2020-11-13 13:16:01 -05:00
Jeff DeCew
1242ae9220 Remove the reply action entirely.
Bug: 163626038
Test: manual
Change-Id: I28992441300ffdecc58900730ff9d858d6c0a009
2020-11-13 13:16:00 -05:00
Jeff DeCew
1842262813 Notification template redesign; part 1.
Known issues:
* Sub-par dyson animation
* Sub-par animation of text in the title
* Notification height limits not yet adjusted
* Decorated custom view height limits not yet updated
* HUNs may need to get their own headerless template
* Messaging style notifications are not yet headerless
* Possible [de]colorization bug for grouped icons
* Some notifications still not always expandable

Bug: 163626038
Test: Manual, visual testing
Change-Id: I9e7e2fd689938a13e042c8f6319bd7d0d2252781
2020-11-13 13:16:00 -05:00
Oli Lan
ab89267d93 Merge "Enable instrumentation of system server on debuggable devices." 2020-11-13 17:51:09 +00:00
Aurimas Liutikas
9079c1754f Merge "Remove legacy style metalava suppression" 2020-11-13 16:33:52 +00:00
TreeHugger Robot
fd53945195 Merge "Remove pi.append_native_lib_paths property" 2020-11-13 03:24:38 +00:00
Aurimas Liutikas
1394a019e7 Remove legacy style metalava suppression
@SuppressLint("Doclava125") is a legacy way of suppressing
RequiresPermission check. Updating to the new style of suppression
so metalava no longer has to support the legacy mode.

sed -i "s/@SuppressLint(\"Doclava125/@SuppressLint(\"RequiresPermission/" \
core/java/android/app/admin/DevicePolicyManager.java \
core/java/android/hardware/hdmi/HdmiControlManager.java \
core/java/android/hardware/location/ContextHubManager.java \
core/java/android/hardware/usb/UsbDeviceConnection.java \
core/java/android/net/TrafficStats.java \
core/java/android/os/RecoverySystem.java \
core/java/android/os/storage/StorageManager.java \
core/java/android/service/persistentdata/PersistentDataBlockManager.java \
location/java/android/location/LocationManager.java \
media/java/android/media/AudioManager.java \
telecomm/java/android/telecom/TelecomManager.java \
telephony/java/android/telephony/CarrierConfigManager.java \
telephony/java/android/telephony/TelephonyManager.java \
wifi/java/android/net/wifi/RttManager.java \
wifi/java/android/net/wifi/WifiScanner.java

Test: make
Exempt-From-Owner-Approval: No-op change
Change-Id: I6d5df95cfca2950ea86872d2f0afc1ba828841dc
2020-11-12 18:27:15 -08:00
Alex Johnston
d3c01ef591 add MANAGE_CREDENTIALS appop
This is part of the work to support
a credential management app on
unmanaged devices.

Bug: 165641221
Test: atest android.appsecurity.cts.AppOpsTest
Change-Id: Ifd87b5e38f341db4b34bf9f61480e29e49148846
2020-11-12 21:25:34 +00:00
Eran Messeri
cb1fecb4b4 Merge "Implement setRequiredPasswordComplexity" 2020-11-12 21:17:19 +00:00
Bernardo Rufino
24b362f687 Merge "Require signature|privileged STATUS_BAR for collapsePanels()" 2020-11-12 17:20:03 +00:00
Patrick Baumann
22efaa8422 Remove pi.append_native_lib_paths property
This change removes the "pi.append_native_lib_paths" property added as a kill switch for a feature that has been out in the wild now for several releases now.

Change-Id: I21f9d158f60d0cf47e3631bb37ece711b3450494
Fixes: 173103133
2020-11-12 16:56:39 +00:00
Bernardo Rufino
7d0992ce4f Require signature|privileged STATUS_BAR for collapsePanels()
For apps targeting S+. This API was being exploited by malware to
prevent the user from accessing critical notifications
(go/collapse-status-bar, b/137274359).

This API was hidden and never intended to be used by 3p apps, so putting
it behind proper permission after targetSdk S. Since it's
@UnsupportedAppUsage trying to steer apps to the
Intent.ACTION_CLOSE_SYSTEM_DIALOGS (Intent.ACSD), which produces the
same effect and has been part of the API surface (as opposed to this
one). However, to fix the vulnerability (b/137274359) that intent will
be subjected to further restrictions based on privilege (who) and
circumstance (what), for more details see go/close-system-dialogs.

To lock down the abuse vector, similar restrictions to the ones applied
to Intent.ACSD will be applied to collapsePanels() NOT gated on
targetSdk, but these will be in future CLs.

Test: CTS coming
Bug: 173031413
Bug: 159105552
Bug: 137274359
Change-Id: I05f05ff6a2052820a132c2284101480448d18b77
2020-11-12 14:41:03 +00:00
Eran Messeri
1641c5c47e Implement setRequiredPasswordComplexity
Implement setRequiredPasswordComplexity and
getRequiredPasswordComplexity, which enforce password requiremets
according to one of four, platform-defined complexity levels.

Start adjusting the platform to take the complexity into account:
* isActivePasswordSufficient would return false if complexity is set
  but the current password does not meet the complexity criteria.
* resetPasswordWithToken would not allow resetting the password to a
  value that does not meet the complexity criteria.

Bug: 165573442
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testResetPasswordWithToken
Change-Id: I4e66af0b03c521de70bba3192751164736d01c62
2020-11-12 12:47:11 +00:00
Felipe Leme
dd0fdcce9f Merge "Exposed UnsafeStateException as a public API." 2020-11-12 01:54:51 +00:00
TreeHugger Robot
62a648da25 Merge "Initial definition of DevicePolicySafetyChecker." 2020-11-12 01:49:29 +00:00
Yan Zhu
86cc64534a Merge "DPM and DPMS changes to support DO on AAOS" 2020-11-12 00:01:11 +00:00
Tobias Thierer
2842fcf4ce Merge "Fix malformed OWNERS." am: 37ef4e0be3 am: 6ecdbeb992 am: 428f6b01c2 am: 046471cec7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1496271

Change-Id: Ic31ceac3f156fde0b9e45e929e7e723a02d423ab
2020-11-11 22:26:26 +00:00
Tobias Thierer
046471cec7 Merge "Fix malformed OWNERS." am: 37ef4e0be3 am: 6ecdbeb992 am: 428f6b01c2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1496271

Change-Id: I21174bf9a885e93416852d9a60a33e2d789dcc65
2020-11-11 22:01:46 +00:00
Tobias Thierer
428f6b01c2 Merge "Fix malformed OWNERS." am: 37ef4e0be3 am: 6ecdbeb992
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1496271

Change-Id: I06d3cea0211ec0c1f545993a1ec914eb59b3ae68
2020-11-11 21:42:12 +00:00
Tobias Thierer
107c4a524e Fix malformed OWNERS.
Per go/android-owners, include directions should be of the form
[gerrit_project_name]:[absolute_path_to_included_file].

Exempt-From-Owner-Approval: Only editing OWNERS file that ought
to be owned by ourselves, anyway.

Bug: 159055442
Test: Treehugger
Change-Id: I4238c3b0895819a96ca5ab0151f772ecdde588ff
2020-11-11 20:45:39 +00:00
Felipe Leme
766e6ae8c8 Exposed UnsafeStateException as a public API.
And some related APIs as @TestAPI.

Test: m update-api
Bug: 172376923

Change-Id: I3fc5806e2d34e161a409f49ada263d430ec9bc02
2020-11-11 12:30:15 -08:00
Felipe Leme
6b94ea477f Initial definition of DevicePolicySafetyChecker.
This object will be used to fail DevicePolicyManagers that cannot be
executed on automotive when it's not safe to (for example, because
the vehicle is moving).

Test: atest CarDevicePolicyManagerTest#testLockNow_safe \
            CarDevicePolicyManagerTest#testLockNow_unsafe
Bug: 172376923

Change-Id: I7f910a7ee5efc7d647525db1687bd27e68cb7c0a
2020-11-11 11:04:36 -08:00
Chong Zhang
c035a6f07b Merge "ActivityManager: use proc state from compiled aidl" 2020-11-11 18:57:13 +00:00
Vishnu Nair
38309e8f6e Add ability to cancel ANR dialogs
Currently, ActivityManager doesn't know whether an app has become
responsive. Notify it about a responsive connection so that it can hide
the ANR dialog.

Bug: 171218828
Test: manual test with an unresponsive app
Test: atest AnrTest
Test: logcatcolor | grep -i windowmanager and observe the logs from WM
about ANR happening and ANR stopping.

Change-Id: Ie950015e5794232f1c59c2c7b3101723fcaf5a46
2020-11-11 10:55:11 -08:00
Eran Messeri
7c1f402328 Merge "DPMS: Fix password complexity comparison" 2020-11-11 09:44:30 +00:00
Eran Messeri
e38292a29b DPMS: Fix password complexity comparison
The method for validating whether a given password is sufficient for a
given complexity was returning the wrong value in the general case.
validatePasswordMetrics should return true when the actualMetrics of
a password satisfy the minComplexity passed in.

However, the isPin argument, skews the result such that an all-digit
PIN is considered not sufficient, because the only credential type
recognized in that method is the "password" type, and for that
credential type a non-digit character is required.

This worked for checking whether the password is sufficient in the
UI code, where isPin indicated whether the user chose a PIN or password.
However it does not work for the general case, for example for enforcing
complexity.

This change gets rid of the 'allowsNumericPassword()' criteria for
complexity buckets. Instead, the minimal length is calculated based on
whether the actualMetrics already have a non-numeric character, OR
a non-numeric character is required by the admin-set password quality
requirements (in the case when merging complexity and quality).

Bug: 172312413
Bug: 165573442
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Test: atest MixedDeviceOwnerTest MixedProfileOwnerTest OrgOwnedProfileOwnerTest  MixedDeviceOwnerTestApi25 MixedManagedProfileOwnerTest
Change-Id: I3227d4d8e6825b5c4ea525828d7e09f52702065b
2020-11-11 07:09:12 +00:00
Joanne Chung
b26c3edc97 Merge "Allow voice recognition service to blame other apps access." into rvc-qpr-dev am: 5a9a2bc30d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13026536

Change-Id: Ibe30e7c3a8c7d21c17d16c71ca43f2a9a59f9cae
2020-11-11 06:44:56 +00:00
Joanne Chung
6aaa106d83 Allow voice recognition service to blame other apps access.
This is a workaround solution for Android R QPR2. We are not allowed
to change the API for QPR release. This is a special case that allows
the current voice recognizer to note proxy ops if it is also the
voice interactor. In S, we will define a new permission that designed
one as a trusted blamer and tie it to a role.

Bug: 17095434
Test: manual
Test: TreeHugger presubmit

Merged-In: I506bbeb95e622b99693dbf5a135c7961b7fd81c1
Change-Id: I0852d1bb438d25b3e93224a71de1bf3b6df72c1c
2020-11-11 11:04:15 +08:00
Kurt Dresner
22dc4e8261 Merge "Expand visibility of projection state API so Android Auto can access it." 2020-11-10 23:46:51 +00:00
Chong Zhang
423349508c ActivityManager: use proc state from compiled aidl
bug: 172942349
bug: 159172726
test: builds
Change-Id: I3dafe7a75b2dae561583a7821284027a1896b9a5
2020-11-10 12:38:31 -08:00
Julia Reynolds
53766bd74a Merge "Sync internal notif categories with androidx" 2020-11-10 19:51:01 +00:00
Nate Myren
88319e978f Merge "More robust null check in isTrustedVoiceServiceProxy" 2020-11-10 19:46:21 +00:00
Nate Myren
ecb07b0c0f More robust null check in isTrustedVoiceServiceProxy
Ensure that the component name unflattening does not result in a null
value before getting the package name.

Fixes: 172854122
Test: Manual
Change-Id: Icbcacc87308bdb87fd45e055240fd72458e478f5
2020-11-10 09:10:53 -08:00
Shuo Qian
b570ddfa05 Merge "Introduce new App Ops permission for 3rd-party InCallService" am: 9666e05985 am: 84838b0a56
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1484359

Change-Id: Ibc6de7ee13fde894e793cc1a7ba1fa88e034cb75
2020-11-10 04:24:03 +00:00
Hall Liu
c82d6aa915 Reexpose ActivityManager#updateMccMncConfiguration
Add the SystemApi tag back to updateMccMncConfiguration for Telephony
mainline.

Fixes: 172284754
Test: atest ActivityManager#testUpdateMccMncConfiguration
Change-Id: Id6a8639aef26c39fb23d9339142c42f7518fc074
2020-11-09 14:44:44 -08:00
TreeHugger Robot
012eb24033 Merge "Add APermissionManager_checkPermission to libandroid" 2020-11-09 21:25:28 +00:00
sqian
74207ec1fb Introduce new App Ops permission for 3rd-party InCallService
This permission is intended to be used internally as a system App Ops permission, and let CompanionDeviceManager or RoleManager to grant with
users. If it is granted by user, the corresponding companion app has the ability to query the details of the ongoing calls, and also manage its life cycle.

Bug: 169595473
Test: atest ThirdPartyInCallServiceAppOpsPermissionTest
Change-Id: Ie0f790aab2edcd52cfdbded2630347b9f8dd4d49
Merged-In: Ie0f790aab2edcd52cfdbded2630347b9f8dd4d49
(cherry picked from commit 334ab546e4)
2020-11-09 21:00:55 +00:00
Kurt Dresner
9993831106 Expand visibility of projection state API so Android Auto can access it.
The PROJECTION_TYPE_* constants and re{quest,lease}Projection APIs were originally marked @TestApi and @hide, but Android Auto needs them to be part of the @SystemApi to be able to use them.

Bug: 134997071
Bug: 169702986
Test: Unit tests, tested against Android Auto
Change-Id: Id8f3fb8697726ba20ea5a2843026c2083c0bec92
2020-11-09 09:38:23 -08:00
Mathew Inwood
5a448e27ed Merge "Add maxTargetSdk restriction to unused APIs." am: f8abe13db4 am: eb80316624
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1468245

Change-Id: I60222cb1879651cf283e385519b5c4d156ab68a1
2020-11-09 15:24:20 +00:00
Collin Fijalkovich
5e687f4544 Merge "Add tracepoint for reportFullyDrawn" 2020-11-09 15:19:46 +00:00
Mathew Inwood
f8abe13db4 Merge "Add maxTargetSdk restriction to unused APIs." 2020-11-09 14:41:20 +00:00
Riddle Hsu
9873b97017 Merge "Preserve window for Activity#recreate if possible" 2020-11-09 08:31:37 +00:00