Commit Graph

16802 Commits

Author SHA1 Message Date
Philip P. Moltmann
da554e4de0 Collect AsyncNotedAppOp in same call as noteOp
This reduces the overhead of collecting noted app-ops to the same amount
of binder calls as if we would not have the feature

Before (conceptionally):
---------------------------------
mode = service.noteOp()
if (mode == allowed && shouldCollectAsyncOp) {
   fixup(message)
   service.noteAsyncOp()
}
----------------------------------

After (conceptionally):
----------------------------------
if (shouldCollectAsyncOp) {
   fixup(message)
}
mode = service.noteOp(shouldCollectAsyncOp, message)
----------------------------------

Bug: 136505050
Test: atest CtsAppOpsTestCases
Change-Id: If1b535a7c4b0f431f251c5d06cdf496c34920e23
2020-01-03 12:37:23 -08:00
Philip P. Moltmann
d8c0bda6a6 Use Pools for noteOp related data objects
... to avoid too frequent allocations of small objects.

There is no pool for NoteOpEvent objects as they are only freed in very
uncommon situation. Hence they are directly reinited instad of going
through a pool.

Test: atest CtsAppOpsTestCases
Bug: 136595429
Change-Id: Ia39ca9682771cbc44ddbeaadc55f7e3f17c86449
2020-01-03 10:08:03 -08:00
TreeHugger Robot
f0031d2eba Merge "Replace com.android.internal.util.Preconditions.checkNotNull with java.util.Objects.requireNonNull" 2020-01-03 17:58:18 +00:00
Automerger Merge Worker
08c2f021de Merge "Use ro.product.vndk.version for unbundled product apks" am: cbfcd44f68 am: e0e165f06e am: bbce9e0c5a
Change-Id: I781e0f1f9e70e584b986d5b2c7e7e87804c52157
2020-01-03 07:51:13 +00:00
Automerger Merge Worker
bbce9e0c5a Merge "Use ro.product.vndk.version for unbundled product apks" am: cbfcd44f68 am: e0e165f06e
Change-Id: I6507b31c3a1b36830a231064e560d978b9427f5c
2020-01-03 07:36:52 +00:00
Justin Yun
1ef374f98b Use ro.product.vndk.version for unbundled product apks
Instead of using "ro.product.apps.unbundled", use
"ro.product.vndk.version" to determine if product apks are unbundled.
"ro.product.vndk.version" will be defined by
PRODUCT_PRODUCT_VNDK_VERSION. If it is defined, all product apks must
be unbundled.

Bug: 144534640
Bug: 127738095
Bug: 128557860
Test: boot and check logs if product apps are loaded successfully
Change-Id: I6d0f7c20e131dfe12203c63a14e6254a8223893b
2020-01-02 06:30:02 +00:00
Tej Singh
b8f296da22 Unit tests for PullAtomMetadata
Bug: 146385269
Test: bit FrameworksCoreTests:android.app.PullAtomMetadata
Change-Id: I4c78d2744348dbab6ee792caa0a7a8bbd3c17f28
2019-12-30 13:04:46 -08:00
Daulet Zhanguzin
0af97d60d7 Replace com.android.internal.util.Preconditions.checkNotNull with
java.util.Objects.requireNonNull

Bug: 126528330

Test: Treehugger
Change-Id: I42117ebfb640e3b0b133183e5e146860bed8471a
2019-12-30 15:41:28 +00:00
Chavi Weingarten
9ec9264138 Merge "Removed regionId from updateTapExcludeRegion request." 2019-12-27 16:24:50 +00:00
chaviw
aa0d74e6c6 Removed regionId from updateTapExcludeRegion request.
There was no need for regionId in the request since you can just replace
the previous region with a new one. This reduces confusion and
simplifies the code. This also allowed TapExcludeRegionHolder to get
deleted and just store the excluded region in the WindowState.

Additionally, this fixed a bug where the excluded region would get
overwritten when the window region was smaller. If the window region was
resized later, the exclude region would remain small.

This is also preparing for more uses of this API with embedded windows
and window magnification.

Test: ActivityViewTest
Change-Id: Ia151115b5a5e8f2ce5e606fe627821dcfef5d9b5
2019-12-26 15:47:37 -08:00
Wale Ogunwale
194435b5a2 Introduce WINDOWING_MODE_MULTI_WINDOW
Generic multi-window with no presentation attribution from the wm-core.
Needed for wm-shell to correctly drive multi-window cases like Bubbles
and n-way-split.
Current windowing modes split and freeform will probably be migrated to
this once wm-shell drives their presentation.

Test: N/A
Bug: 139371701
Change-Id: I5247f41b4f67d21b2bb5929a52e8ec93c41644c2
2019-12-26 12:56:09 -08:00
TreeHugger Robot
1e4c5237df Merge "Add minimal post processing API to framework" 2019-12-25 13:14:51 +00:00
Ben Lin
eefcd54641 Merge "Add #onPictureInPictureRequested to Activity and ATM" 2019-12-23 22:08:59 +00:00
Michael Groover
8142ee3e61 Merge "Make DPM#checkDeviceIdentifierAccess a SystemApi" 2019-12-23 21:26:09 +00:00
TreeHugger Robot
3f7ef32b9f Merge "New API for query trust of a fs-verity certificate" 2019-12-23 20:18:40 +00:00
Victor Hsieh
20fe1f6f22 New API for query trust of a fs-verity certificate
The corresponding service is also added.

The API can be used by a store to know whether their certificate is
trusted on the device. As optimization, they only need to download
.fsv_sig signature file if it will be used.

The API can also be used to gradually switch to stronger key. The store
can query with their certificates in priority order and download the best
signature.

Test: Passed new GTS working in progress
Bug: 142573505
Change-Id: Ic788cd04aeaed35ad62113fe9e7535b8fa63b5ee
2019-12-23 09:21:19 -08:00
Galia Peycheva
056b3ee745 Add minimal post processing API to framework
This API allows applications to instruct the connected display to do minimal
post processing on the produced image or video frames. This will switch the
display to a low latency mode (ALLM, Game mode or some other custom
implementation thereof), reducing lag in the final images. Thus, minimal post
processing would greatly enhance performance for gaming and video
conferencing applications. It would not, however, suit applications that
prioritise image quality over performance.

This CL adds 2 public method:
 - Window.setPreferMinimalPostProcessing()
(this can also be set in WindowManager.LayoutParams.preferMinimalPostProcessing)
If minimal post processing is preferred, the connected display will be requested
to go into low latency mode, which reduces image processing, resulting in better
performance for gaming applications. If the Display sink is connected via HDMI,
the device will begin to send infoframes with Auto Low Latency Mode enabled and
Game Content Type. This will switch the connected display to a lower latency
mode (if available).
For more information, see HDMI 2.1 specification.

If the Display sink has an internal connection or uses some other protocol than
HDMI, effects may be similar but implementation-defined.

 - Display.isMinimalPostProcessingPreferred()
Returns true if the connected display supports either Low Latency Mode (ALLM or
some other custom low latency implementation) or Game content type.

Bug: 135116095

Test: make -> flash on ATV OTT device -> open an activity which requests minimal
post processing -> check SurfaceControl logs -> verify correct signals are
passed to native

Change-Id: I5508bb9e5c138b0f2b42d8f8fab10e1915ba3cb6
2019-12-23 17:27:55 +01:00
Eran Messeri
6125f5fdc6 Merge "Individual attestation: throw if unsupported" 2019-12-23 15:50:51 +00:00
Song Pan
6e3677c0c3 Implement methods in AppIntegrityManagerServiceImpl.
1. Pushing rules.
2. Getting version/rule provider.
3. Handle integrity verification request

Bug:143689885

Test: atest AppIntegrityManagerServiceImplTest
Change-Id: I0f2d554efbd3ba115eab10238908c9c2a3f2139c
2019-12-23 13:24:08 +00:00
TreeHugger Robot
41ffe9852c Merge "Allow pullAtomCallbacks to be unregistered in Java" 2019-12-21 08:41:45 +00:00
Jing Ji
c7fe838a0f Merge "Add API to allow app to report ANR by its own" 2019-12-20 22:54:56 +00:00
jorgegil@google.com
06bc3233c7 Add #onPictureInPictureRequested to Activity and ATM
Allows vendors to signal that an activity should enter
picture-in-picture if possible.
Additionally, removes the need for an Activity to go
through onPause to enter picture-in-picture. Apps can
now override this new API and enter PIP from there
instead of relying on #onUserLeaveHint.

Bug: 143365086
Test: atest FrameworksCoreTests:android.app.activity.ActivityThreadTest
Test: atest CtsWindowManagerDeviceTestCases:PinnedStackTests
Test: atest WmTests:ActivityTaskManagerServiceTests
Change-Id: Ib7ae9d1a7055ceed73e9643982033de9d4ad7350
2019-12-20 14:38:25 -08:00
Winson Chung
afbe32079a Merge "Clean up remote animation definitions when activity is destroyed" 2019-12-20 17:52:36 +00:00
Lucas Dupin
5465b18518 Merge "Enable WCG support for ImageWallpaper" 2019-12-20 17:28:49 +00:00
Automerger Merge Worker
08074c62b0 Merge "[Tether13] Move TetheringManager into framework" am: 2410d67357 am: 25cc1f47c5
Change-Id: I9ec25eb984e3b534ddcc9313836a319b21526998
2019-12-20 14:00:29 +00:00
Mark Chien
ebc76bc2e9 Merge "[Tether13] Move TetheringManager into framework" 2019-12-20 05:04:08 +00:00
Etan Cohen
195a4f72c6 Merge "[WIFICOND] Formalize the wificond AIDL interface" 2019-12-20 03:58:10 +00:00
TreeHugger Robot
741a368bb0 Merge "Move ImsManager registery to TelephonyFrameworkInitializer" 2019-12-20 03:54:42 +00:00
Philip P. Moltmann
baa2cea8c3 Merge changes from topic "RefactorAppOpAccessCounters"
* changes:
  Encapusale running app-ops in an object
  Refactor app-op access/reject counters
2019-12-20 03:04:55 +00:00
markchien
ae8aa646dc [Tether13] Move TetheringManager into framework
Move tethering out of ConnectivityService. All client would
use TetheringManager to talk with TetheringService directly.

Bug: 144320246
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
2019-12-20 10:31:31 +08:00
Jayachandran C
e80ab40f70 Move ImsManager registery to TelephonyFrameworkInitializer
Bug: 140768340
Test: Build
Change-Id: I299fea193a157ce4c4b073a4b804739c7e4ba400
2019-12-19 16:13:46 -08:00
Philip P. Moltmann
6c6403e395 Encapusale running app-ops in an object
... instead of having some counters.

Also:
- No need to store token/clientId in system server
- startOP/finishOp does not require a featureId, null is ok.

Fixes: 144997947
Change-Id: Ic955cb2686f3d53b957d816397e978a80cf4d29b
2019-12-19 15:14:57 -08:00
Winson Chung
10fc25dadd Clean up remote animation definitions when activity is destroyed
- Remove the remote animation definition when the associated process dies
- Also expose method to unregister any registered animation defs

Bug: 139137636
Test: Kill launcher, ensure the remote animation ref is removed
Change-Id: Ia38d037397703221c17c8258ec1a245055d5896d
2019-12-19 15:01:50 -08:00
TreeHugger Robot
f8a45ea20d Merge "Add R scoped storage app-ops" 2019-12-19 22:56:54 +00:00
Jing Ji
83c6bc5d27 Add API to allow app to report ANR by its own
Bug: 140025078
Test: atest CtsAppTestCases:ActivityManagerTest#testAppNotResponding
Change-Id: Iaa57057b18a41a2f934d709b88790625ffcf5478
2019-12-19 14:13:54 -08:00
Etan Cohen
5abc6d980d [WIFICOND] Formalize the wificond AIDL interface
The wificond daemon provides an interface for the framework to interact
with the operating system when managing Wi-Fi. Since wificond is outside
the mainline module, the AIDL interface has to be formalized as an API
surface.

Bug: 140062898
Test: atest android.net.wifi
Test: atest com.android.server.wifi.aware
Test: (CTS) atest android.net.wifi.cts
Test: scan, association, SoftAP operations manually tested, kill wificond
Change-Id: Iee0fef6a454fdd84b1d0c59516d4746ddc2a4ce5
2019-12-19 11:57:04 -08:00
Joshua Mccloskey
0cf243eafd Merge "Add builder method to check DevicePolicyManager" 2019-12-19 18:21:44 +00:00
Eran Messeri
20f982faa5 Individual attestation: throw if unsupported
Throw if a caller requests the individual device attestation certificate
to be used for key attestation, but the feature is unavailable in the
device's StrongBox implementation.

Bug: 140194470
Bug: 136494773
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedDeviceOwnerTest#testKeyManagement
Change-Id: Ie289dae2949400443efd14832cb847761b2b92e7
2019-12-19 14:33:46 +00:00
markchien
6d06f6d51a [Tether13] Move TetheringManager into framework
Move tethering out of ConnectivityService. All client would
use TetheringManager to talk with TetheringService directly.

Bug: 144320246
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
Merged-In: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
2019-12-19 20:53:06 +08:00
TreeHugger Robot
f0862553d7 Merge "Use new UnsupportedAppUsage annotation." 2019-12-19 08:04:35 +00:00
TreeHugger Robot
87bb84da38 Merge "Add query functionalities to query all of crates" 2019-12-19 07:16:37 +00:00
Michael Groover
d4de2c34ad Make DPM#checkDeviceIdentifierAccess a SystemApi
The device identifier check is performed within Telephony; one of
the checks uses a hidden method within DevicePolicyManager to perform
a device / profile owner access check. In order for Telephony to
invoke this method as a mainline module it must be made into a
SystemApi.

Fixes: 145163986
Test: atest DeviceOwnerTest#testDeviceOwnerCanGetDeviceIdentifiers
Test: atest DeviceOwnerTest#testDeviceOwnerCannotGetDeviceIdentifiersWithoutPermission
Test: atest ManagedProfileTest#testProfileOwnerOnPersonalDeviceCannotGetDeviceIdentifiers
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testProfileOwnerCannotGetDeviceIdentifiersWithoutPermission
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testProfileOwnerCanGetDeviceIdentifiers
Test: atest TelephonyPermissionsTest
Change-Id: Ica015f848209fc693a44fa019b25796260191e64
2019-12-18 20:21:30 -08:00
Tej Singh
fa1c137d66 Allow pullAtomCallbacks to be unregistered in Java
Adds an API to unregister pullAtomCallbacks.
Fixes bug where the StatsEventParcels are null.
Makes onPullAtom a oneway call.
OnPullAtom returns an int code instead of a boolean
Made the APIs return RuntimeExceptions

Test: make, boots
Test: atest GtsStatsdHostTestCases
Bug: 146385842
Bug: 146385173
Bug: 144373250
Change-Id: I107a705a9024240c5c9f9e276293de8410e2b6f3
2019-12-18 18:52:10 -08:00
Philip P. Moltmann
49bd9e1e3e Refactor app-op access/reject counters
The last system was too confusing and caused bugs. The new system is
easier to understand.

This still uses the key which is the combination of uidState and
op-flags. I.e. now we collect access + rejection events for the
cross-product of
- package (parameter to noteOp)
- featureId (parameter to noteOp)
- op (parameter to noteOp)
- uidState of the package the noteOp was called
- opFlags (based on which app called the noteOp and how trusted this app
was)

uidState + opFlags are usually combined into the "key" variable.

This also unifies the APIs in Op*Entry to be the same of each data-field
of an op-entry.

Note: This temporarily breaks
com.android.server.appop.AppOpsActiveWatcherTest#testIsRunning as active
ops are not yet reported. This needs to be fixed by a follow up change.

Bug: 144997947
Test: atest --test-mapping services/core/java/com/android/server/appop/
Change-Id: I9844f9886b1c032d01de51bbb46267e3244b6da6
2019-12-18 18:03:46 -08:00
joshmccloskey
15c0a441c9 Add builder method to check DevicePolicyManager
This is a hidden method and BiometricService will enforce
that 3rd party applications cannot use it.

Fixes: 142966163
Test: Verified disabling fingerprint will not allow
the user to unlock work apps with fingerprint. (But can use fingeprint
within apps.)
Test: Verified disabling face and/or iris on a fingerprint device will
continue to
allow the user to unlock work apps with fingerprint.
Test: Verified disabling face on a face authentication device
will not allow the user to unlock work apps with face authentication.
(But can use face
authentication within apps.)
Test: Verified disabling fingerprint and/or iris on a face
authentication device will continue to allow the user to unlock work
apps with face authentication.

Change-Id: I21ae00d0993d78a641cb8c5d8af2dd02be0b4a21
2019-12-18 16:12:36 -08:00
TreeHugger Robot
bce6abd2b7 Merge "Fix TaskDescription's copy method" 2019-12-18 22:26:49 +00:00
Mark Renouf
3095609f4e Merge "Expose snapshotTask for use in WindowManager" 2019-12-18 21:34:52 +00:00
Mehdi Alizadeh
c5e29907c4 Fix TaskDescription's copy method
copyFromPreserveHiddenFields should only copy hidden fields if the field
is set in the other TaskDescription.

Bug: 144348683
Test: atest FrameworksCoreTests:ActivityManagerTest

Change-Id: I8475e82b7aeb0b7fc6a8cc0de88b926a847c7ac2
2019-12-18 11:47:37 -08:00
Mark Renouf
98ba8e6905 Expose snapshotTask for use in WindowManager
Exposes snapshotTask which will immediately take a task snapshot
instead of checking the cache. Also adds an overload which allows
specifying scaleRatio and pixelFormat

Change-Id: I0ee3d90ae0ff508e10a8b24bd47d593f28ab1ea8
2019-12-18 14:05:41 -05:00
Philip P. Moltmann
b43dfe3007 Add R scoped storage app-ops
Test: Booted
Bug: 136219229
Change-Id: I52abec0b7ae08b8bc3e22f875c92cfa8f275ece5
2019-12-18 10:49:33 -08:00