Commit Graph

2291 Commits

Author SHA1 Message Date
Eugene Susla
6015cb062b RESTRICT AUTOMERGE am: b4aaa9d8ad
Change-Id: I47af344ace38759669c9e13a03aee96d3ed40b9e
2020-04-01 20:58:33 +00:00
Eugene Susla
b4aaa9d8ad RESTRICT AUTOMERGE
Prevent accessing companion records from arbitrary uids

Test: manual
Fixes: 129476618
Change-Id: I7b18cfcdf58e62a445cbb508116c6ce7c1cea8d7
2020-03-16 14:15:22 -07:00
Shuzhen Wang
e375ee8f8a Camera: Add new hidden API for camera open/close callback
The hidden API is used by SystemUI process to adjust the system UI based
on when a certain camera is opened or closed.

Test: Manually observe callbacks in SystemUI when running camera CTS
Bug: 150540299
Change-Id: I04cae782d96f0e32be8ef588dcd328f84b32887a
Merged-In: I04cae782d96f0e32be8ef588dcd328f84b32887a
2020-03-10 11:34:26 -07:00
Joanne Chung
77e6f5ff3e Change permissionLevel of ACCESS_SHORTCUTS and UNLIMITED_SHORTCUTS_API_CALLS
ACCESS_SHORTCUTS and UNLIMITED_SHORTCUTS_API_CALLS should be granted to
an app predictor rather than a text classifier.

Bug: 139523153
Test: atest CtsPermission2TestCases
Change-Id: I12360b5d5ba3c75bb2dfffd86bd6069b75fbdb53
(cherry picked from commit b6a7851271)
2020-01-17 06:54:31 +00:00
Etan Cohen
7c8fce66ab [WIFI] Protect broadcasts used by the Wi-Fi framework
Make sure the broadcasts used by the Wi-Fi framework are protected:
i.e. can only be transmitted by privileged components (as opposed to
any 3rd party app).

Broadcast: Suggestion API

Bug: 146642727
Test: atest android.net.wifi
Test: atest com.android.server.wifi
Merged-In: I9a0bf4428774b13cc6414a223f378e09341a6a55
Change-Id: I9a0bf4428774b13cc6414a223f378e09341a6a55
2019-12-27 12:47:18 -08:00
Etan Cohen
66a71e55b3 [WIFI] Protect broadcasts used by the Wi-Fi framework
Make sure the broadcasts used by the Wi-Fi framework are protected:
i.e. can only be transmitted by privileged components (as opposed to
any 3rd party app).

Broadcast: MAC randomization

Bug: 146642727
Test: atest android.net.wifi
Test: atest com.android.server.wifi
Change-Id: Id4c7c0868ced4b3edb8752e10c0350c190cee862
Merged-In: I9a0bf4428774b13cc6414a223f378e09341a6a55
2019-12-27 12:46:28 -08:00
TreeHugger Robot
4918e711d3 Merge "Fix permission javadoc about whitelisting." into qt-dev 2019-07-23 17:16:14 +00:00
Hai Zhang
f2cf8d1bc3 Fix permission javadoc about whitelisting.
Fixes: 138122977
Test: presubmit
Change-Id: I8dec56e4385877789ea3504bc1efbe59ad0ddbb7
2019-07-22 21:06:40 +00:00
Kevin Hufnagle
e0fd9ab53b docs: Added protection level to permissions
All permissions that are suitable for use by third-party apps and
aren't deprecated now contain a paragraph in their descriptions that
lists the protection level for a given permission, such as:

Protection level: signature|privileged

Test: make ds-docs
Bug: 137260540
Change-Id: I45eada81bf4aa83480ff2e701a9e0e9932b66b88
2019-07-18 14:00:07 -07:00
shitian.ma
62018f8a7c Fix CTS case failed in CtsAutoFillServiceTestCases
The case failed due to AutofillManager can not find the ResolveInfo of AutofillCompatAccessibilityService.
AutofillCompatAccessibilityService is not visible for instant App.
Cts test process is working at other users. And the calling App is instant App.
So cts test process can’t get service info of AutofillCompatAccessibilityService.

Bug: 137236035
Test: run cts -m CtsAutoFillServiceTestCases
Change-Id: I4dffc615ea1d8290bc02e51a9aa055fa0ead467f
2019-07-17 11:08:58 -07:00
Dan Sandler
8c7b8cbd39 Q card.
(Goodbye, hypno-P and your '90s tech magazine color palette.)

Bug: 123903304
Test: adb shell am start -n android/com.android.internal.app.PlatLogoActivity
Test: adb shell am start -c com.android.internal.category.PLATLOGO -a android.intent.action.MAIN
Test: adb shell am start -n com.android.egg/.paint.PaintActivity # still works
Change-Id: I4865024a14b6a78e7a043c56d2330b5f9dd214c6
Merged-In: I4865024a14b6a78e7a043c56d2330b5f9dd214c6
2019-07-10 17:21:30 +00:00
Svet Ganov
3f01e91f7e Document restricted permissions
Test: N/A

Bug: 132174864

Change-Id: If56475fc6ac72e17bed8b0960cc63a8ecc87e4de
2019-07-09 13:28:36 -07:00
Matt Pape
4892d1355b Merge "Add verifier protection level to WRITE_DEVICE_CONFIG permission." into qt-dev 2019-06-26 15:55:26 +00:00
Philip P. Moltmann
64f20dd158 Set LEGACY_STORAGE only from READ_EXTERNAL_STORAGE
Not from WRITE_EXTERNAL_STORAGE. Otherwise it is not clear what happens
if one of the permissions is white-listed and one not. This can lead to
a loop where we try to set LEGACY_STORAGE to two different values.

Fixes: 135763654, 135742960
Bug: 135933014
Test: atest RestrictedPermissionsTest
Change-Id: I35883f12525360fd7f760750505a27644342955c
2019-06-25 09:59:40 -07:00
Stanislav Zholnin
046519c7ac Add verifier protection level to WRITE_DEVICE_CONFIG permission.
Test: manually verified
Bug: 135704293
Change-Id: Ia12b343ed4c49bc11a1669b12813d6fea7a68454
2019-06-25 12:32:01 +01:00
TreeHugger Robot
b23292da1d Merge "Changed comments to match real protection level" into qt-dev 2019-05-29 16:01:12 +00:00
Nate Myren
59627e1393 Changed comments to match real protection level
Test: none
Fixes: 121181371
Change-Id: Ib946ee09ead7c8d112675c119f5e71a67d57c3c2
2019-05-28 16:06:18 +00:00
Chalard Jean
ae4c7775e2 Let the system server have CONNECTIVITY_USE_RESTRICTED_NETWORKS.
Also :
- Fix testUidFilteringDuringVpnConnectDisconnectAndUidUpdates that
  was failing on devices with a first released SDK >= Q
- Add a test actually tests that the system has the permission, as
  the test was only testing what's in the mock

Bug: 119770201
Test: New test making sure this stays true
Merged-In: I74cf5f0fa17fcf818f1fed78c7e3e4375c20152e
Change-Id: I0daa644fbad8e389ad7cfa66c0e3b3480c8bb50a
(cherry picked from commit 629b49d58f)
2019-05-28 13:30:14 +00:00
Philip P. Moltmann
cac85873d3 Make loc bg perm restricted
Fixes: 132175290
Test: Checked that restriction related flags are set in adb shell
dumpsys package
Change-Id: Idfc3a948713396f831530dd9e07c0a916c259e66
2019-05-22 16:24:08 -07:00
Kevin Hufnagle
913248188e docs: Request coarse location with b.g. location
When requesting background location access (for "all-the-time" access
to device location), it's possible to request *either* coarse or fine
location access along with background location access. Updated the
docs to mention this important point.

Test: make ds-docs -j32

Bug: 133248358
Change-Id: Ia10e493ecb33b6e971b53d3ff348a495417d9b38
2019-05-21 12:26:12 -07:00
Jeff Sharkey
b66f4f4bad Aggresive performance optimizations.
Now that we have LocalCallingIdentity, we can start caching it in
very narrow cases.  We must be careful to not cache too long, since
any changes to granted permissions for the UID mean we need to
re-evaluate any cached answers.

The best middle-ground for this in the Q release is to use an active
camera session as a proxy for when we should create a cache object
and then later invalidate it.  (It's very unlikely that a user
changes permissions while actively using the camera, and this is
a strong signal that the caller is sensitive to performance.)

Many other sprinkled optimizations to avoid extra binder calls into
the OS, such as aggressively caching VolumeInfo related details.

Track IDs that are owned by each LocalCallingIdentity, to speed up
all future security checks.

Dispatch all change notifications asynchronously, and delay them by
several seconds while the camera is being actively used, to give
more important foreground work a fighting chance.  Invalidate
thumbnails asynchronously.

Optimizations to ModernMediaScanner where it's safe to skip the
"reconcile" and "clean" steps when we're focused on a single file
that we successfully scanned.

Local tests show this CL improves performance of a test app that
takes 100 rapid shots by 45%.  (All the collective optimizations
done so far this week add up to a 70% improvement.)

Bug: 130758409
Test: atest --test-mapping packages/providers/MediaProvider
Exempt-From-Owner-Approval: trivial manifest change
Change-Id: I38cc826af47d41219ef44eae6fbd293caa0c01d5
2019-05-18 05:48:21 +00:00
TreeHugger Robot
13e4ff16c4 Merge "Add an API for launching intent to view permission usage." into qt-dev 2019-05-14 13:24:56 +00:00
Svet Ganov
810d48445b Add an API for launching intent to view permission usage.
Adding a new intent acttion for the permission controller to ask an
app to show its permission usage to help the user understand what
and why is being used. We are adding a permission to protect this
action to prevent apps trampolining into other apps when asked to
show their permission usge.

Test: compiles

bug:131760942

Change-Id: I5217d6319fd98d40c8879bdd7af5fe466bf9143e
2019-05-13 03:40:13 +00:00
shafik
4831ad7039 Fail to enable rollback if enable rollback times out
Make PackageManager send a ACTION_CANCEL_ENABLE_ROLLBACK intent to
RollbackManager. RollbackManager marks the relevant rollback as invalid.
Allow enable rollback to continue as usual, before making the rollback
available, RollbackManager checks whether it's valid. If it's not, the
rollback data is deleted.

Add a test case for expired rollback enabling attempt in RollbackTest.

Test: atest RollbackTest#testEnableRollbackTimeoutFailsRollback
Test: manual -
      * Set ENABLE_ROLLBACK_TIMEOUT_MILLIS to 1 ms using DeviceConfig
      * Install a mainline module with rollback enabled
      * adb shell dumpsys rollback
      * observe that no rollback was made available
Fixes: 131679409

Change-Id: Iaa4dbff002b820aff1fc3e1b985f129cf5ebe2e6
2019-05-09 12:38:04 +01:00
Svet Ganov
d563e937f2 Make storage a restricted permission - framework
This change makes storage a soft restricted permission. When the
permission is whitelisted for an app then hodlding it allows the
app to access the full SD card as on a P device. If howerver, the
permisison is not whitelisted for an app then holding it allows
accessing the visual/aural collections in media store while the
app would run in its own isolated storage sandbox.

This change also connects the opt in/out application attribute
to how external storage is mounted remocing temporary code. The
attribute was renamed to convey that opting in legacy mode is
not somethung that is desirable or would be available in the long
run.

White at this also fix the default state of app ops for restricted
permissions to avoid allowing ops for non requested restricted
permissions to every UID as component access could skip permission
checks by cannot skip app op checks.

bug:130327036

atest CtsPermission2TestCases
atest CtsPermissionTestCases
atest CtsAppOpsTestCases
atest atest CtsAppSecurityHostTestCases:android.appsecurity.cts.ExternalStorageHostTest
atest CtsAppSecurityHostTestCases:android.appsecurity.cts.PermissionsHostTest

Change-Id: Ibb23cbb6a5c66d9c3823cc13562a1b903b391ffd
2019-04-16 12:34:49 -07:00
Varun Shah
f2f148a524 Merge "Add TestApi to SUSPEND_APPS permission for GTS test." into qt-dev 2019-04-10 23:03:06 +00:00
Svet Ganov
d8eb8b2690 Restricted permission mechanism - framework
This change adds a mechanism for restricting permissions (only runtime
for now), so that an app cannot hold the permission if it is not white
listed. The whitelisting can happen at install or at any later point.

There are three whitelists: system: OS managed with default grants
and role holders being on it; upgrade: only OS puts on this list
apps when upgrading from a pre to post restriction permission database
version and OS and installer on record can remove; installer: only
the installer on record can add and remove (and the system of course).

Added a permission policy service that sits on top of permissions
and app ops and is responsible to sync between permissions and app
ops when there is an interdependecy in any direction.

Added versioning to the runtime permissions database to allow operations
that need to be done once on upgrade such as adding all permissions held
by apps pre upgrade to the upgrade whitelist if the new permisison version
inctroduces a new restricted permission. The upgrade logic is in the
permission controller and we will eventually put the default grants there.

NOTE: This change is reacting to a VP feedback for how we would handle
SMS/CallLog restriction as we pivoted from role based approach to roles
for things the user would understand plus whitelist for everything else.
This would also help us roll out softly the storage permisison as there
is too much churm coming from developer feedback.

Exempt-From-Owner-Approval: trivial change due to APi adjustment

Test: atest CtsAppSecurityHostTestCases:android.appsecurity.cts.PermissionsHostTest
Test: atest CtsPermissionTestCases
Test: atest CtsPermission2TestCases
Test: atest RoleManagerTestCases

bug:124769181

Change-Id: Ic48e3c728387ecf02f89d517ba1fe785ab9c75fd
2019-04-07 22:39:54 -07:00
Mill Chen
48004da4f6 Send a broadcast for grayscale changed
Add android.settings.action.GRAYSCALE_CHANGED to protected broadcast
list.

Bug: 118387886
Test: manual
Change-Id: I67c49ead44c81880bceef708315ed98c8a69508a
2019-04-05 10:52:50 -07:00
Varun Shah
85d80b57fb Add TestApi to SUSPEND_APPS permission for GTS test.
Bug: 129911490
Test: atest com.google.android.wellbeing.permissionpolicy.gts.WellbeingPermissionPolicyTest
Change-Id: I61152f07987deb5c5c088d78ccd9ef79b09cbb95
2019-04-04 23:31:52 +00:00
Michael Wright
89df2a72f7 Merge "Expose input region monitoring to system components." 2019-04-03 16:04:03 +00:00
Michael Wright
c7995239ef Expose input region monitoring to system components.
This is to allow SysUI to detect system-wide gestures.

Test: manual
Bug: 123748692
Change-Id: Ic1e2cd6afea219d0e20b29e7150c9a42b75c7a67
2019-04-03 13:46:30 +01:00
Paul Hu
1d5f6d3b9e Merge "Address leftover comments on 923337 and 930217." am: 1e97aab6f4 am: 55a22b5d17
am: 1d7b92b9d5

Change-Id: I75eadb66c81d72c768e77feddd383d60f8accd65
2019-04-02 01:29:08 -07:00
Paul Hu
1e97aab6f4 Merge "Address leftover comments on 923337 and 930217." 2019-04-02 07:39:04 +00:00
Philip P. Moltmann
8f8cf3430b Merge "Remove dual storage permission model" 2019-04-01 23:45:23 +00:00
Philip P. Moltmann
129a0b0c5e Remove dual storage permission model
- Also remove typed media permissions
- Leave typed media app-ops

Bug: 129716569
Test: Used apps, looked at permissions in the UI
Change-Id: If7714fb1a6955584157e1a60ab72b09e35287827
2019-04-01 16:30:11 -07:00
Roshan Pius
82ccc59370 Merge "AndroidManifest.xml: Add new network permission for carrier provisioning" 2019-04-01 19:57:11 +00:00
Tyler Gunn
5454921b08 Merge "Mark PROCESS_OUTGOING_CALLS permission as deprecated." am: 70e943ba80 am: 41ab607d3d
am: ef0b0ae2da

Change-Id: Ib93302e0aa41b98adcc9489a8b183e7a57434eb4
2019-04-01 08:00:13 -07:00
Tyler Gunn
70e943ba80 Merge "Mark PROCESS_OUTGOING_CALLS permission as deprecated." 2019-04-01 14:13:50 +00:00
paulhu
3d67f53b02 Address leftover comments on 923337 and 930217.
- Restrict unprivileged apps to use
  NetworkRequest.Builder#setSignalStrength.

- Remove the "throws NullPointerException" in
  CaptivePortalProbeSpec constructor.

- Remove the null check in LinkProperties.

- Add annotataion into all ConnectivityManager.NetworkCallback
  methods.

Change-Id: Id275cac1d6a30d7515cd7b113394f5e8a0179314
Fix: 129097486
Test: atest FrameworksNetTests
2019-04-01 16:24:10 +08:00
Tyler Gunn
f8c3cca932 Mark PROCESS_OUTGOING_CALLS permission as deprecated.
We deprecated the NEW_OUTGOING_CALL broadcast which uses this, so we
should also deprecate the permission to make it more clear to the
developers.

Test: Build / make api
Bug: 129531123
Bug: 129572090
Change-Id: Iac4979ffe29c33eb2ed8ffe4a7799e7caa794951
2019-03-30 04:50:46 +00:00
Roshan Pius
831cbaa270 AndroidManifest.xml: Add new network permission for carrier provisioning
Adding a new permission for carrier provisioning app to access privileged
network operations.

Bug: 129401919
Test: Compiles

Change-Id: I86e6aa3aaeabbc3637977f9e9a34daaec92d59aa
2019-03-29 14:29:06 -07:00
Mark Chien
eea398a690 Merge "Only apply entitlement check to cellular upstream" 2019-03-28 09:52:52 +00:00
Mark Chien
7d1f0fb263 Merge "Only apply entitlement check to cellular upstream" 2019-03-28 08:38:40 +00:00
markchien
3b519638a3 Only apply entitlement check to cellular upstream
Instead of doing a tethering entitlement check whenever we turn
on tethering, provisioning result should only affect mobile
upstream. List behavior changes below:

1. Change tether entitlement check from pre-flight check to
run-time check.
2. Only run entitlement check when upstream is mobile.
3. Move schedule entitlement re-check logic from Settings to
framework.
4. Run all entitlement thing in TetherMaster thread to avoid
multi-thread problem.

Test: -atest FrameworksNetTests
      -build, flash, booted
bug: 111490073
Change-Id: Ic2980b4d6864d6f7287816c43eb6cf7a5cdec541
Merged-in: Ic2980b4d6864d6f7287816c43eb6cf7a5cdec541
2019-03-28 11:18:07 +08:00
Kevin Rocard
cba4b211e5 Merge "Introduce a system APC with its corresponding opt-out" 2019-03-27 20:41:06 +00:00
Youming Ye
a2f3fa9dd5 Enable Telecom to bind third party InCallServices.
Changes for Telecom to bind third party companion apps or
automotive ui installed from Play Store. Add new permissions and
settings for the third party InCallService APIs.

Bug: 78174835
Test: Manual
Change-Id: I1b4eff28b9dfd61f1c951d14b6c82395b51fe769
Merged-In: I1b4eff28b9dfd61f1c951d14b6c82395b51fe769
2019-03-27 08:27:29 -07:00
markchien
a0d280fc54 Only apply entitlement check to cellular upstream
Instead of doing a tethering entitlement check whenever we turn
on tethering, provisioning result should only affect mobile
upstream. List behavior changes below:

1. Change tether entitlement check from pre-flight check to
run-time check.
2. Only run entitlement check when upstream is mobile.
3. Move schedule entitlement re-check logic from Settings
framework.
4. Run all entitlement thing in TetherMaster thread to avoid
multi-thread problem.

Test: -atest FrameworksNetTests
      -build, flash, booted
bug: 111490073
Change-Id: Ic2980b4d6864d6f7287816c43eb6cf7a5cdec541
2019-03-27 04:17:11 +00:00
Joe Onorato
1c33a64705 Merge "incidentd can now handle multiple callers asking it for incident reports" 2019-03-27 04:06:06 +00:00
Po-Chien Hsueh
43037e40e7 Merge "Add a permission, INSTALL_DYNAMIC_SYSTEM" 2019-03-27 03:21:19 +00:00
Jean-Michel Trivi
2c1ac86e54 ACTION_SPEAKERPHONE_STATE_CHANGED: only broadcast by system
Bug: 74541410
Test: change speakerphone state in call, check logs
Change-Id: Ifce2a4594d4e9faaa7e0352d22b82ae5dbe2e025
2019-03-26 15:20:21 -07:00