Commit Graph

17401 Commits

Author SHA1 Message Date
Anna Trostanetski
6d1c0c7d90 Merge "Cache binder calls in CompatChanges" into rvc-dev 2020-02-27 14:58:13 +00:00
Evan Rosky
73a7fe9479 Clean-up old docked-stack implementation from WM
Bug: 133381284
Test: Existing tests pass. Manually use sysui
Change-Id: I44155d74df1489fa391c60a05d1f8098986cefb7
2020-02-25 21:13:16 +00:00
TreeHugger Robot
10398d29f3 Merge "Atom for when fgs accesses appop" into rvc-dev 2020-02-25 19:59:16 +00:00
Peter Kalauskas
81a320279e Merge changes from topic "new-task-snapshots-rvc-dev" into rvc-dev
* changes:
  Disable reduced scale if reduced scale config is 0
  Store original task width and height instead of scale
2020-02-25 18:29:50 +00:00
Samuel Fufa
086e11fdb6 Merge "Clear registered prediction callbacks on destroy" into rvc-dev 2020-02-25 18:08:32 +00:00
Adam Bookatz
38767932a2 Atom for when fgs accesses appop
statsd logs when an sensitive appop is accessed while a foreground
service is held. These appops include
OP_FINE_LOCATION
OP_COARSE_LOCATION
OP_RECORD_AUDIO
OP_CAMERA

It logs the number of times each of these appops is requested per session
during which the uid holds any foreground service.
Appops requested while the app's process state is TOP are ignored.

Also, the pre-existing ForegroundServiceStateChanged atom has an
additional field that logs whether the fgs is considered 'in-use' in the
context of being allowed while-in-use permissions.

Bug: 149497535
Test: atest UidAtomTests#testForegroundServiceState UidAtomTests#testForegroundServiceAccessAppOp
Test: manually monitor: adb shell cmd stats print-logs && adb logcat -v uid -s statsd | grep "statsd  : {" | egrep '\((60|256)\)'

Change-Id: I991a427dc2ab00399188b10b266ab2d9aa92696d
Merged-In: I991a427dc2ab00399188b10b266ab2d9aa92696d
(cherry picked from commit 0c8637c067)
2020-02-25 17:09:48 +00:00
Makoto Onuki
9577cd78ff Merge "Squash same ApplicationInfo's in Parcel" into rvc-dev 2020-02-25 15:17:14 +00:00
atrost
c1877300d3 Cache binder calls in CompatChanges
Cached call values are kept in ChangeIdStateCache (per-process cache).
Use "cache_key.is_compat_change_enabled" system property to
invalidate the cache (i.e. any value different from the last observed
will trigger an invalidation).
Any process can read that property, but only system server can change it.

Rolling forward the original caching with invalidating the cache upon
package install/update.
Tested fix locally by using the API in SoftRestrictedPermissionPolicy.java,
and running android.permission2.cts.RestrictedStoragePermissionSharedUidTest
which installs some apps with the same uid, which modifies the result of
isChangeEnabled. With the additional cache invalidation the test passes.

ToDo: add CTS test for the caching.

Bug: 140441727
Test: atest PlatformCompatTest
Test: atest CompatConfigTest
Test: atest CompatChangesTest
Test: atest PlatformCompatGating
Change-Id: I0265df1c427b43592e4f4d32fe9cfeb8fbc1bfa9
2020-02-25 13:20:10 +00:00
Makoto Onuki
6d81a5f569 Merge "Revert "Add WTF when a system server wrapper can't be found"" into rvc-dev 2020-02-25 12:53:58 +00:00
Zhuoyao Zhang
3495b81006 Revert "Add WTF when a system server wrapper can't be found"
This reverts commit 2cddb8a891.

Reason for revert: break app compat test b/149923038

Bug: 149923038
Change-Id: Ibace06f704595d40a4439c0bdfea55d11294ba77
2020-02-25 12:53:29 +00:00
Galia Peycheva
641e2e6361 Create DreamManager System Server TestApi
Bug: 141771803
Bug: 133216167

Test: atest DreamManagerServiceTests
Test: make checkbuild

Merged-In: I937061138bc8ccaf4475674f00331c3fe1c5a495
Change-Id: I937061138bc8ccaf4475674f00331c3fe1c5a495
(cherry picked from commit 4467c53c11)
2020-02-25 12:32:02 +00:00
Galia Peycheva
a72d7e53e6 Merge changes Id71b4cbc,I8dff0a12,Ife3d1390 into rvc-dev
* changes:
  Add startDreamActivity request verification
  Make DreamService use an Activity
  Clean up dreamland
2020-02-25 10:11:21 +00:00
Galia Peycheva
6861e91b84 Make DreamService use an Activity
Currently, the DreamService uses a floating Window to display the
content of the dream on the screen. This introduces difficulties in the
interactions with the Assistant application, which is an activity.
By design, if the Assistant is invoked while the device is dreaming, the
Assistant should be shown on top. However, since floating windows are
always drawn on top of all activities, the Assistant can't be shown on
top of the Dream.

Here, we migrate the implementation of the DreamService to use an
Activity (DreamActivity). Since the screensaver application is not part
of the framework, we can't declare the activity in their AndroidManifest.xml.
Therefore, we start the dream activity with a dedicated method in
ActivityTaskManagerService.

Bug: 133216167
Test: 1. m && ./vendor/google/tools/flashall
      2. Go to Settings > Device Preferences > Screensaver > Start now
      3. Verify dream appears
      4. Click any key to wake up the dream
      5. Verify that dream disappears

Merged-In: I8dff0a124cd1b41fb925a73528305431b49ee06d
Change-Id: I8dff0a124cd1b41fb925a73528305431b49ee06d
(cherry picked from commit 148478a85e)
2020-02-25 07:56:28 +00:00
TreeHugger Robot
0cbb2687ed Merge "Move PiP animation to SysUI package" into rvc-dev 2020-02-25 03:10:24 +00:00
Makoto Onuki
2d80ca09fc Squash same ApplicationInfo's in Parcel
ApplicationInfo now automatically tries to "squash" the same instances in a
Parcel.

NOTE: This CL still does *not* optimize the package manager APIs that return a
list. e.g. PM.queryContentProviders() still return duplicate AppInfo's.
We can optimize them by making ParcelableListSlice call "allowSquashing",
but that *could* have negative side effects, so I'm not doing it in this CL.
I think we can do that for S.

Bug: 148588589
Test: atest CtsContentTestCases # except for two preexsiting failures:
- android.content.pm.cts.PackageManagerTest#testGetIcon
- android.content.pm.cts.PackageManagerTest#testGetPreferredActivities

Test: Use the debugger and make sure bindApplication() is not receiving
duplicate AppInfo's in the provider list.

Change-Id: I3ba2c047a469169340c0f75c36bdfd394bc5d627
(cherry picked from commit 7d09275d70)
2020-02-24 22:22:13 +00:00
Hongwei Wang
85cf41fcc3 Move PiP animation to SysUI package
The bounds animation is cleaned up within window manager and it's now
the SysUI component listening on callbacks from TaskOrganizer for
entering to and exiting from PiP mode.

Additionally, the expand and move of the PiP window is now part of SysUI
as well.

Known issues:
- Black background when in transition from PiP to fullscreen. The
wallpaper gets into hidden state too early
- App gets into PiP mode too early when entering PiP, need to defer the
configuration change sent to app in this case

Bug: 146594635
Bug: 148198539
Bug: 138144750
Bug: 149569903
Test: atest PinnedStackTests
Test: atest PipAnimationControllerTest
Test: atest RecentsAnimationTest
Test: atest RecentTasksTest
Test: atest com.android.server.wm.ActivityStarterTests
Merged-In: Id0c8ce03fa26952daf5e3687b18b2eb2375b7d20
Change-Id: Id0c8ce03fa26952daf5e3687b18b2eb2375b7d20
2020-02-24 21:16:20 +00:00
Peter Kalauskas
84f02a81e8 Disable reduced scale if reduced scale config is 0
Change reduced scale implementation to toggle on/off based on
config_lowResTaskSnapshotScale=0 instead of ro.config.low_ram=true

Also, only use _reduced.jpg if reduced scale is enabled.  Previously,
for task snapshots, [0-9]+_reduced.jpg would be used if reduced scale
was disabled, and [0-9]+.jpg would never be used. This patch swaps that
behavior to make the underlying system more intuitive.  Now, if reduced
snapshots are disabled, store the task snapshot in [0-9]+.jpg and never
use [0-9]+_reduced.jpg.

Also, store low-res snapshots at config_lowResTaskSnapshotScale.
Prevously, low-res snapshots were stored at lowResScale * highResScale

Test: TaskSnapshotCacheTest
Test: TaskSnapshotControllerTest
Test: TaskSnapshotPersisterLoaderTest
Test: TaskSnapshotSurfaceTest
Bug: 148099851
Bug: 142063079
Change-Id: I5a0d58766347d875eaec138820323063aa1c2988
2020-02-24 21:02:03 +00:00
Peter Kalauskas
fe0a413a60 Store original task width and height instead of scale
Store the original task snapshot size instead of the scale from which
the bitmap was saved. This simplifies the logic around restoring and
saving from the proto, as both the reduced scale and full scale
snapshots make use and share the same state.

Also remove scale from TaskSnapshot, and remove and reducedScale from
TaskSnapshot.Builder.

Test: TaskSnapshotCacheTest
Test: TaskSnapshotControllerTest
Test: TaskSnapshotPersisterLoaderTest
Test: TaskSnapshotSurfaceTest
Bug: 148491788
Bug: 148617404
Bug: 142063079
Change-Id: I1dccaba87c3d8b95bf4156f41f9fd5d40019f675
2020-02-24 21:01:03 +00:00
Samuel Fufa
191149a4d0 Clear registered prediction callbacks on destroy
destroy() removes callbacks from AppPredictionManagerService but not
from mRegisteredCallbacks.

Bug: 149388856
Test: manual
Change-Id: Id08d6b20362486bd1640310c64da35e0382d9b5e
2020-02-24 19:06:21 +00:00
Julia Reynolds
229684b01a Address api feedback
Test: make
Fixes: 150008110
Change-Id: I5163cd49b11444e856cd9bd8ae2fd634da5f6a39
2020-02-23 20:44:26 -05:00
TreeHugger Robot
d566d02ff3 Merge "Rename full and reduced scale configs" 2020-02-21 23:28:35 +00:00
Evan Severson
2aa3230ca0 Merge "Add method to give a permission revoke a reason" 2020-02-21 23:16:09 +00:00
Ashwini Oruganti
b06c32f68a Merge "Resolve conflicting values of usesCleartextTraffic for shared processes" 2020-02-21 23:07:41 +00:00
Winson Chung
c4d8bcad86 Merge "Ensure task description icon resources are loaded from the right package" 2020-02-21 22:59:44 +00:00
Kevin Chyn
df244da79a Merge changes from topic "biometric-and-credential"
* changes:
  Always start AuthController
  Clean up biometric system server
2020-02-21 21:37:14 +00:00
Tim Murray
8a9c5795e0 Merge "Cache package and permission information" 2020-02-21 20:22:19 +00:00
Automerger Merge Worker
b1b13b1b3f Merge "Revert "Cache binder calls in CompatChanges"" am: e879968fbf am: 1da820d954 am: 0ea7868a9d
Change-Id: I93eb6fca846b8a56b145ddd62fa7a2f86256884a
2020-02-21 20:11:25 +00:00
Automerger Merge Worker
0ea7868a9d Merge "Revert "Cache binder calls in CompatChanges"" am: e879968fbf am: 1da820d954
Change-Id: I3bc8bea4eb5dcc7fbda8a3372083e04337e95242
2020-02-21 19:45:41 +00:00
Automerger Merge Worker
1da820d954 Merge "Revert "Cache binder calls in CompatChanges"" am: e879968fbf
Change-Id: I2fd44d5f95c66d57c8cf779a8b18a10b4e2e965c
2020-02-21 19:25:51 +00:00
Ashwini Oruganti
9330d5e32b Resolve conflicting values of usesCleartextTraffic for shared processes
Bug: 148240416
Test: Manually tested by installing two apps running in a shared process
and starting their shared process activities in various orders. The
value of usesCleartextTraffic gets set as expected.
Change-Id: Ib350c09c42d5524734fb259a2ab787790f2d8e30
2020-02-21 09:52:58 -08:00
Peter Kalauskas
4dc04606da Rename full and reduced scale configs
Rename:
  config_fullTaskSnapshotScale -> config_highResTaskSnapshotScale
  config_reducedTaskSnapshotScale -> config_lowResTaskSnapshotScale

Both full and reduced scale can be "reduced" from 100%, so name them
more clearly.

Test: TaskSnapshotCacheTest
Test: TaskSnapshotControllerTest
Test: TaskSnapshotPersisterLoaderTest
Test: TaskSnapshotSurfaceTest
Bug: 148617404
Bug: 142063079
Change-Id: Ie8073d5a3048c19450308b2af22d363deaa51b6a
2020-02-21 17:06:19 +00:00
Anna Trostanetski
9c6ecc90c5 Revert "Cache binder calls in CompatChanges"
Reason for revert: cache needs to be cleared on package install.
This is much simpler to do in internal master with recent changes
(ag/10172190) so I'm reverting the cache from aosp to keep it correct,
and cherrypicking this into internal master.

Change-Id: I71757a5b60fbdba3c69322b95a20527a1e3a66e9
2020-02-21 16:38:32 +00:00
Andrii Kulian
02c0e4d2ac Handle config/display changes for WindowContext
Introduce IWindowToken to report config/display changes from
server side. When config change callback is received,
it will update the resources associated with the window token.

Test: WindowContextTests
Bug: 128338354
Bug: 146820733

Change-Id: I871bd78a21dbde1286786e65c340b6259b873660
2020-02-21 16:07:32 +08:00
Julius D'souza
e32f290e3e Merge "KeyguardManager set + validate lock API refinement" 2020-02-21 03:19:43 +00:00
Rubin Xu
cb40b9881d Merge "Support security logging on org-owned managed profile devices" 2020-02-21 00:00:03 +00:00
Julius D'souza
ab5461c0da KeyguardManager set + validate lock API refinement
KeyguardManager#validateLockPasswordComplexity
-> KeyguardManager#isValidLockPasswordComplexity

parameter changes: boolean isPin -> int locktype

Bug: 149298492
Test: TreeHugger
Change-Id: Icc1ab6c3a0eb4637d7e6fb34f95b8a72ced50f98
Signed-off-by: Julius D'souza <jdsouza@google.com>
2020-02-20 15:52:11 -08:00
Haining Chen
6c839dd1c6 Merge "Implementations of biometric contraints for weak and convenience tiers (1) 24 hours fallback (2) 4 hours idle timeout" 2020-02-20 21:05:24 +00:00
Kevin Chyn
7d07c89235 Clean up biometric system server
1) BiometricService / AuthService always need to be started, since on
   Android 11 and later, the public credential auth API comes through this
   path.

2) Consolidate getAuthenticatorId() and expose via AuthService. This is
   used only by the platform during key generation. Instead of asking
   each individual service, AuthService will return a list of IDs for
   sensors which are enrolled and meet the required strength.

Test: atest com.android.server.biometrics
Test: fingerprint device, CtsVerifier biometric section
Test: face unlock device, CtsVerifier biometric section
Test: remove biometrics from device, CtsVerifier biometric section

Bug: 148419762
Bug: 149795050

Change-Id: I2c5385b1cd4f343fabb0010e1fe6fb1ea8283391
2020-02-20 11:12:51 -08:00
Daniel Colascione
a46b7b3f5e Cache package and permission information
We use the package settings class as a central point for invalidating
on package information changes; for permission changes, we invalidate
from inside the individual permission data objects.

Bug: 140788621
Test: boots, package tests (pending)
Change-Id: Iec14d4ec872124e7ef4612c72d94c89a7319ace0
2020-02-20 09:24:32 -08:00
Soonil Nagarkar
a6149521d3 Merge "Revert requestSetProviderEnabled API" 2020-02-20 16:34:37 +00:00
Rubin Xu
1480ce7b87 Support security logging on org-owned managed profile devices
When security logging is enabled on org-owned profile devices,
Security events will be redacted to preserve privacy on the personal
profile as follows:

* TAG_ADB_SHELL_CMD
  Shell command will be redacted.

* TAG_MEDIA_MOUNT
* TAG_MEDIA_UNMOUNT
  The media's volume name will be redacted.

* TAG_APP_PROCESS_START
* TAG_CERT_AUTHORITY_INSTALLED
* TAG_CERT_AUTHORITY_REMOVED
* TAG_KEY_GENERATED
* TAG_KEY_IMPORT
* TAG_KEY_DESTRUCTION
* TAG_KEY_INTEGRITY_VIOLATION
  Only events happening inside the managed profile will be returned
  to the admin.

Bug: 148437300
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Test: atest FrameworksServicesTests:SecurityEventTest
Test: atest FrameworksCoreTests:EventLogTest
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSecurityLoggingWithSingleUser
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSecurityLoggingWithTwoUsers
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSecurityLoggingEnabledLogged
Test: atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testSecurityLogging

Change-Id: I2e52229a3163b3e0dc3d80d71700023394d84587
2020-02-20 15:47:29 +00:00
Charles Chen
c56ce6fd08 Merge "Exempt-From-Owner-Approval: Report non-visual Context misuse" 2020-02-20 12:30:06 +00:00
TreeHugger Robot
1ef019d3e0 Merge "Disable Settings toggle if admin has set always-on VPN" 2020-02-20 10:09:34 +00:00
Andrii Kulian
5877c7d6c0 Exempt-From-Owner-Approval: Report non-visual Context misuse
Make obtaining a visual service from non-visual Context instance
report a strict mode violation and print the stacktrace.

Make calling getDisplay() throw an exception if called on an instance
that is not associated with a display. For existing usages introduce
a new internal method that does not perform the verification until
the usages are properly fixed.

Bug: 128338354
Test: StrictModeTest#testIncorrectContextUse_GetSystemService
Test: StrictModeTest#testIncorrectContextUse_GetDisplay
Change-Id: Id25d590eca6e10066e55d7ed6436d3bc9e433beb
2020-02-20 01:29:25 +00:00
Haining Chen
c06c481fcb Implementations of biometric contraints for weak and convenience tiers
(1) 24 hours fallback
(2) 4 hours idle timeout

Bug: 141025588

Test: atest AuthServiceTest
Test: atest KeyguardUpdateMonitorTest
Test: atest BiometricsUnlockControllerTest
Test: atest KeyguardIndicationControllerTest
Test: make -j
Change-Id: I1078ce39a2ae1e4c250b6468e477b703e3016e2c
2020-02-19 23:58:31 +00:00
Winson Chung
d6722037ba Ensure task description icon resources are loaded from the right package
- We previously assumed that icons set in the task description would be
  loaded from the same package as the root activity (which is incorrect),
  instead, they should be fetched from the activity which set them.

  We also deprecate getIcon() because:
  - apps could only get the icons they set previously (not very useful)
  - it didn't return resource icons, only in memory or loaded from disk
  - the name doesn't indicate that it could result in a disk load
  Instead, callers (namely SysUI) should now call loadIcon() to get the
  actual icon directly (or loaded if necessary).

Bug: 143363444
Test: atest TaskDescriptionTest
Test: atest ActivityManagerTest
Change-Id: I48aaba17de2edf0b3a61fa049cf897020d4c2ef1
2020-02-19 15:49:00 -08:00
Automerger Merge Worker
cc5a5939a0 Merge "Revert "Revert "[DexLoadReporter] Report classloader contexts di..."" am: 1ee3e70cf3 am: 2cef69cb5f am: a2c3c9fe10
Change-Id: I6d7ba01f4083ed01eea0ec0dda0b69f27a4b1346
2020-02-19 23:19:40 +00:00
Soonil Nagarkar
3819f972df Revert requestSetProviderEnabled API
Bug: 144955780
Test: presubmits
Change-Id: Iec8520acfd98b9d9d92a4876ebfa899ac2a0731e
2020-02-19 14:39:58 -08:00
Evan Severson
43b2a199ab Add method to give a permission revoke a reason
Test: Compile
Bug: 149861310
Change-Id: I865a300a9795550a2549f928f4e967b2b695439e
2020-02-19 14:23:56 -08:00
Leon Scroggins
658cd3ccff Merge "Switch to SharedElementCallback to HardwareBuffer" 2020-02-19 20:50:21 +00:00