Commit Graph

6447 Commits

Author SHA1 Message Date
Forrest Dunlap
f9063fb1ff Clarify resetToDefaults documentation.
Bug: 170157200

Change-Id: I4cf791795132d02289bf49b3a038990a5adbceb3
2021-03-31 17:03:41 +00:00
Matt Casey
4dddebe4b8 Merge "Revert "Revert "Add setting for touch gesture and long-press hom..."" into sc-dev 2021-03-30 14:23:10 +00:00
Jacky Kao
b599784e05 Merge "Logs magnification feature behavior. (2/2)." into sc-dev 2021-03-29 23:56:22 +00:00
Svet Ganov
8d2ed50604 Runtime permission attribution improvements
When an app is proxying access to runtime permission protected
data it needs to check whether the calling app has a permission
to the data it is about to proxy which leaves a trace in app ops
that the requesting app perofmed a data access. However, then the
app doing the work needs to get the protected data itself from the
OS which access gets attributed only to itself. As a result there
are two data accesses in app ops where only the first one is a
proxy one that app A got access to Foo through app B - that is the
one we want to show in the permission tracking UIs - and one
for the data access - that is the one we would want to blame on
the calling app, and in fact, these two accesses should be one -
that app A accessed Foo though B. This limitation requires fragile
one off workarounds where both accesses use the same attribution
tag and sys UI has hardcoded rules to dedupe. Since this is not
documented we cannot expect that the ecosystem would reliably
do this workaround in apps that that the workaround in the OS
would be respected by every OEM.

This change adds a mechaism to resolve this issue. It allows for
an app to create an attribution context for another app and then
any private data access thorugh this context would result in a
single app op blame that A accessed Foo though B, i.e. we no longer
have double accounting. Also this can be nested through apps, e.g.
app A asks app B which asks app C for contacts. In this case app
B creates an attribution context for app A and calls into app C
which creates an attribution context for app B. When app C gets
contacts the entire attribution chain would get a porper, single
blame: that C accessed the data, that B got the data from C, and
that A got the data form B. Furthermore, this mechanism ensures
that apps cannot forget to check permissions for the caller
before proxying private data. In our example B and C don't need
to check the permisisons for A and B, respectively, since the
permisisons for the entire attribution chain are checked before
data delivery. Attribution chains are not forgeable preventing
a bad actor to create an arbitrary one - each attribution is
created by the app it refers to and points to a chain of
attributions created by their corresponding apps.

This change also fixes a bug where all content provider accesses
were double counted in app ops due to double noting. While at
this it also fixes that apps can now access their own last ops.
There was a bug where one could not pass null getting the attributed
ops from a historical package ops while this is a valid use case
since if there is no attribution everything is mapped to the null
tag. There were some app op APIs not being piped thorough the app
ops delegate and by extension through the app ops policy. Also
now that we have nice way to express the permission chain in a
call we no longer need the special casing in activity manager to
handle content provider accesses through the OS. Fixed a bug
where we don't properly handle the android.os.shell calls with
an invlaid tag which was failing while the shell can do any tag.

Finally, to ensure the mechanims is validated and works end-to-end
we are adding support for a voice recognizer to blame the client
app for the mic access. The recognition service can create a blaming
context when opening the mic and if the mic is open, which would
do all permission checks, we would not do so again. Since changes
to PermissionChercker for handling attribution sources were made
the CL also hooks up renounced permissoins in the request permission
flow and in the permission checks.

bug:158792096
bug:180647319

Test:atest CtsPermissionsTestCases
     atest CtsPermissions2TestCases
     atest CtsPermissions3TestCases
     atest CtsPermissions4TestCases
     atest CtsPermissions5TestCases
     atest CtsAppOpsTestCases
     atest CtsAppOps2TestCases

Change-Id: Ib04585515d3dc3956966005ae9d94955b2f3ee08
2021-03-29 16:49:33 +00:00
Matt Casey
38ced457e0 Revert "Revert "Add setting for touch gesture and long-press hom..."
Revert "Revert "Hide long-press home animation when disabled by ..."

Revert submission 13998375-revert-13958909-mrcasey-lph-GNUFFHLQXH

Reason for revert: Reverting these CLs did not fix the test b/183684181
Reverted Changes:
Iac13fc450:Revert "Hide long-press home animation when disabl...
Ieb43607a8:Revert "Add setting for touch gesture and long-pre...

Change-Id: Ia92b0a1f19dc7423fe1b3796e14582169e58d203
2021-03-29 13:42:09 +00:00
TreeHugger Robot
894cde1030 Merge "[Settings] add readable tests to presubmit" into sc-dev 2021-03-29 11:52:22 +00:00
Kriti Dang
e713ee6c60 Merge changes from topic "cherrypick-Display settings HDR formats-mumvl547ah" into sc-dev
* changes:
  Handling Number Format Exception in DiscreteValueIntegerListValidator
  Hdr format settings [Backend]
2021-03-28 12:25:32 +00:00
Matt Casey
304bd59b3e Merge "Revert "Add setting for touch gesture and long-press home assist..."" into sc-dev 2021-03-25 21:28:34 +00:00
Matt Casey
fabc9f6f27 Revert "Add setting for touch gesture and long-press home assist..."
Revert "Hide long-press home animation when disabled by setting"

Revert submission 13958909-mrcasey-lph

Reason for revert: Possible test breakage b/183684181
Reverted Changes:
Iaaf39e76a:Hide long-press home animation when disabled by se...
I24ee67cf1:Add setting for touch gesture and long-press home ...

Change-Id: Ieb43607a8010b843fc643979953a266cbb84788f
2021-03-25 21:19:00 +00:00
Songchun Fan
1d70937fe7 Merge "[Settings] keys with @TestApi need to have @Readable" into sc-dev 2021-03-25 15:44:33 +00:00
Kriti Dang
b4775b02a7 Hdr format settings [Backend]
Added new APIs to DisplayManager to set the user disabled HDR formats,
and get/set if user disabled formats should be ignored or not.
These new settings are stored in Settings.Global.
Modified the implementation of Display#getHdrCapabilities to not return
the formats disabled by user.

Bug: 172905874
Test: atest CtsDisplayTestCases
Change-Id: I4841af251ee0e4938614b154d0c5239814ea7cd9
Merged-In: I4841af251ee0e4938614b154d0c5239814ea7cd9
2021-03-25 12:41:35 +00:00
Matt Casey
af29800df0 Merge "Add setting for touch gesture and long-press home assistant invocations" into sc-dev 2021-03-25 12:15:09 +00:00
Sudheer Shanka
d2cd698106 Merge "Add DeviceConfig namespace for media." into sc-dev 2021-03-25 06:56:08 +00:00
Ahaan Ugale
dadfd22e74 Merge "Introduce a default Voice IME concept." into sc-dev 2021-03-25 02:59:41 +00:00
Winson Chiu
5ae11b4a58 Merge "Expose the open by default settings screen to apps" into sc-dev 2021-03-25 02:20:37 +00:00
Ahaan Ugale
9672b2e58c Introduce a default Voice IME concept.
This is configured by the system config resource,
config_systemSpeechRecognizer, which also provides the default
VoiceRecognitionService and the holder for the SYSTEM_SPEECH_RECOGNIZER
role.

InputMethodManagerService updates the new DEFAULT_VOICE_INPUT_METHOD
setting and handles changes to the config_systemSpeechRecognizer value.

No updates are made through the Settings UpgradeController because any
updates that would be needed are already handled by the logic for config
value changes.

Testing:
1. Enable DEBUG logging in InputMethodManagerService.
2. $ m -j && adb remount && adb shell stop && adb sync && adb shell start
3. $ adb shell settings get secure enabled_input_methods; \
 adb shell settings get secure default_input_method; \
 adb shell settings get secure disabled_system_input_methods; \
 adb shell settings get secure default_voice_input_method
4. Check logcat to make sure nothing looks suspect.

Cases tested:
- IME wasn't already in the enabled IME list
- IME was already enabled
- no value for config_systemSpeechRecognizer
- new user added
- locale changed
- config package doesn't have an IME
- update without config value, then set a config value
- config value updated (when both values had valid IMEs)
- combinations of the above cases, as appropriate

Bug: 175480456
Test: manual - see above
Test: atest InputMethodUtilsTest
Test: atest CtsInputMethodTestCases --retry-any-failure
Change-Id: I1abdc145e3d5969fbb69811df2ca2e35c7a177e1
2021-03-24 23:07:21 +00:00
Songchun Fan
3f08960272 [Settings] add readable tests to presubmit
This will enforce the readable tests for changes made to Settings.java.

Test: atest
BUG: 183530680
Change-Id: Ie91350b29c10868cecd2c2fe4eba378278b3cb23
2021-03-24 22:37:44 +00:00
Winson
b5ba585b39 Expose the open by default settings screen to apps
With the changes for app links v2, apps need a way to link users into
the domain selection screen if the app relies on opening web links
for some functionality.

To achieve that, this exposes the existing action,
ACTION_APP_OPEN_BY_DEFAULT_SETTINGS, from android.provider.Settings
and removes the permission needed to launch the relevant Activity,
since it's no longer required.

Note that this will also require a change to remove the enforcement
from the Activity declaration, which will be a follow up.

Bug: 178648367

Test: none, unhide API

Change-Id: I73231b9b4686ee67490ffe1526542b2f59c8089b
2021-03-24 12:43:06 -07:00
Songchun Fan
da9e388d20 [Settings] keys with @TestApi need to have @Readable
This allows them to be accessed by test apps.

BUG: 183223092
Test: atest CtsAppSecurityHostTestCases:android.appsecurity.cts.ReadableSettingsFieldsTest#testSecurePublicSettingsKeysAreReadable
Change-Id: I2bdcab2d9279f5ef944b17896c7b31b84ca8dc81
2021-03-24 18:15:53 +00:00
Matt Casey
662f32ddc2 Add setting for touch gesture and long-press home assistant invocations
No UI, just setting storage and the code to honor that setting.

Bug: 182216673
Bug: 182220287
Test: manual + atest NavigationBarTest
Change-Id: I24ee67cf196d7ae698a731e00a9eb5a726eddb24
2021-03-24 11:49:38 -04:00
Sudheer Shanka
36cf320611 Add DeviceConfig namespace for media.
Bug: 174699413
Test: manual
Change-Id: I9c749f34931f9197e428ae9d5044062d705efed6
2021-03-24 06:59:23 -07:00
Abhijeet Kaur
7591e2d06a Make getExternalStorageMountMode as SystemApi
Secondary volumes are FUSE mounted, whereas Android/data and Android/obb
on primary volumes are not FUSE mounted. Access to these private app
directories on primary volumes is restricted using the mount modes, but
access for these on secondary volumes need to be regulated by
MediaProvider.

Make getExternalStorageMountMode as SystemApi so that MediaProvider
can leverage the same mount logic for Secondary volumes.
Expose relevant mount modes as SystemApi as well.

This change saves us the maintenance overhead for Secondary volumes for
Android S+. Otherwise we would have to check if an app is a signature
app through APIs which would basically be the duplication for the
logic in StorageManagerService.java.

Expose ExternalStorageProvider and downloads Authority for MediaProvider
to rely only on APIs. This is also required for CDD modifications that
these 2 providers are given exceptional access to private app dirs.

Bug: 175796984
Bug: 173505864
Bug: 173505864
Test: atest DownloadProviderTest
Test: atest CtsScopedStorageHostTest
Test: atest android.scopedstorage.cts.host.PublicVolumeHostTest#testCheckInstallerAppAccessToObbDirs
Test: atest android.scopedstorage.cts.host.PublicVolumeHostTest#testCantAccessOtherAppsExternalDirs
Change-Id: I51bc7bd3f355fadd9de56ac267469c2352eb0ffa
Merged-In: I51bc7bd3f355fadd9de56ac267469c2352eb0ffa
2021-03-24 09:28:27 +00:00
Xiaoyu Jin
d988ccfa8e Merge "Add DeviceConfig namespace for AppSearch" into sc-dev 2021-03-24 05:29:12 +00:00
Jacky Kao
f8fb7b24bc Logs magnification feature behavior. (2/2).
Uses the atom MagnificationModeWithImeOnReported in westworld to log
the activated mode when the IME window is shown on the screen.

Adding a new callback API in the MagnificationCallback to monitor the
IME window visibility changes. The A11y framework registers the
callback when the magnification is enabled. It logs the related
data when it receives the IME window visibility changes through
this callback and the magnification is in the activation.

Bug: 154021596
Test: a11y CTS & unit tests
Test: make statsd_testdrive && ./out/host/linux-x86/bin/statsd_testdrive 346
Merged-In: I49b02e00d5a1131b388eeb923440f59a2b4f81a6
Change-Id: I49b02e00d5a1131b388eeb923440f59a2b4f81a6
(cherry picked from commit 1aa113d8dd)
2021-03-24 05:10:57 +00:00
Peter Wang
3c8304207b Merge "[API Review] Change ACTION_MANAGE_ALL_SIM_PROFILE_SETTINGS API" into sc-dev 2021-03-24 03:24:20 +00:00
Rambo Wang
6d768fb7d6 Merge changes from topics "ServiceState#dataRegState", "ServiceState#duplexMode" am: c289c9b0a2 am: 506d5c92c3 am: 507e3b9dcd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1636779

Change-Id: Ic8faff9d023b492da5eb7e31e281ddfbf49c8d1d
2021-03-24 03:01:54 +00:00
Rambo Wang
de0c5fa090 Public ServiceState#duplexMode in telephony provider am: 4481b5181e am: b336d92aa7 am: 57456a7152
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1638159

Change-Id: I2f53c2305075011904718ba5a81279875dc07235
2021-03-24 03:01:39 +00:00
John Li
bb9e119844 Merge "Add Settings flag for Transform." into sc-dev 2021-03-24 02:21:00 +00:00
TreeHugger Robot
074666c5a0 Merge "Add support for selected contacts device to device sharing." into sc-dev 2021-03-23 22:11:22 +00:00
Xiaoyu Jin
eefbf02162 Add DeviceConfig namespace for AppSearch
Adds a new namespace to DeviceConfig for features
relating to AppSearch.

Bug: 173532925
Test: build
Change-Id: I5887899d9292bf88ea5007d94c20b8690ee73872
2021-03-23 13:08:43 -07:00
TreeHugger Robot
77cbe77beb Merge "Enable RESTRICTED bucket." into sc-dev 2021-03-23 18:58:14 +00:00
Rambo Wang
cff9760e07 Export ServiceState#DataRegState into telephony provider
Keep ServiceState#getDataRegState hide. Apps can get the same
info from telephony provider without loation permission.

Bug: 182601774
Test: atest com.android.phone.ServiceStateProviderTest
Change-Id: I1ba72a5b767761d2f7bd1b52459a0c9d101061a2
2021-03-23 09:33:21 -07:00
Rambo Wang
4481b5181e Public ServiceState#duplexMode in telephony provider
ServiceState#getDuplexMode is a public API. Expose the same
info through telephony provider to let applications retreive
it without location permission.

Bug: 182601774
Test: atest com.android.phone.ServiceStateProviderTest
Change-Id: I19128c938993f351533aca9a8e1a1356e21eb30e
2021-03-23 09:27:42 -07:00
Rambo Wang
8fadaef00c Merge "Expose ServiceState#getDataNetworkType in telephony provider" am: 9446a5239f am: 11264381a4 am: ff97f102cc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1639370

Change-Id: Ib2c5d3ec7b28e37d1fa7426aa9e0a1bc7730b9e8
2021-03-23 15:57:25 +00:00
Grace Jia
2bd23cfbcc Add support for selected contacts device to device sharing.
Bug: 163085177
Test: CTS tests
Change-Id: I4f6da463a29ba9cf067d36941a9b4e584012c817
Merged-In: I4f6da463a29ba9cf067d36941a9b4e584012c817
2021-03-23 15:51:24 +00:00
John Li
8929a2e804 Add Settings flag for Transform.
Bug: 177299699
Test: manual
Change-Id: I4947117b6bb11678e3ad761204d720354b9e73ae
Merged-In: I4947117b6bb11678e3ad761204d720354b9e73ae
2021-03-23 07:50:22 +00:00
Rambo Wang
6a7df3f4e8 Expose ServiceState#getDataNetworkType in telephony provider
Data network type is key information to make the switching
decision. Exporting to telephony provider can let application
get the information without location permission.

Bug: 182601774
Test: atest com.android.phone.ServiceStateProviderTest
Change-Id: I9753eee2619baf6b1627835624444c0e4f0cd410
2021-03-22 12:24:19 -07:00
Tej Singh
f6561f6c82 Merge "Add statsd flags to public namespaces" into sc-dev 2021-03-22 18:22:48 +00:00
TreeHugger Robot
41ec7a8e38 Merge "Add device config parameters to DiscreteRegistry." into sc-dev 2021-03-21 22:56:05 +00:00
Stanislav Zholnin
3c46aca490 Add device config parameters to DiscreteRegistry.
DiscreteRegistry cut off and quantization can be set using
adb shell device_config command.

Bug: 176965672
Test: in development
Change-Id: If4df5413d7c7f9bcbdcb751ac2ab772d51c1da80
2021-03-21 21:18:23 +00:00
Tej Singh
8d5fd36dd1 Add statsd flags to public namespaces
Add statsd_java and statsd_java_boot to PUBLIC_NAMESPACES, which allows
feature flagging in app-side statsd code (in
packages/modules/StatsD/framework)

Test: TH
Bug: 181823899
Change-Id: Ia3f92a21a9bc050373de6c6fa4969a4d3af4bccb
2021-03-19 22:54:21 +00:00
Jeff DeCew
6f667c3b5a Minimal change to remove development settings.
Fixes: 183120687
Test: manual
Change-Id: I5632e131b47058ebe25ab21db004eb90498bc299
2021-03-19 15:59:47 -04:00
Jordan Liu
1dfc25617a Make backport_s_notif_rules readable
Bug: 182313963
Test: atest
Change-Id: I4a0ba25a8a5f0674696a83e931ce2aa914c7e7ea
(cherry picked from commit a5792f7402)
Merged-In: I4a0ba25a8a5f0674696a83e931ce2aa914c7e7ea
2021-03-19 19:52:00 +00:00
TreeHugger Robot
b50b960b35 Merge "Add the intent to navigate to MANAGE_MEDIA permission page" into sc-dev 2021-03-19 01:00:40 +00:00
Songchun Fan
e6383a6d3d [Settings] add @Readable back for block_untrusted_touches, maximum_obscuring_opacity_for_touch
These settings are marked @hide to encourage the usage of wrapper APIs.
They should still be readable for any app via the public APIs in
InputManager.

BUG: 183067125
Test: atest android.server.wm.WindowUntrustedTouchTest
Change-Id: I2a3aff0e3bb2ecfba439323fc09b353bd0f2106f
2021-03-18 18:16:06 +00:00
Kweku Adams
0793e0de68 Enable RESTRICTED bucket.
Also reduce the minimum time delay to enter the bucket to 4 hours. The
current default remains 30 days.

Bug: 183103253
Test: atest AppStandbyControllerTests
Test: atest CtsJobSchedulerTestCases
Test: atest CtsUsageStatsTestCases:UsageStatsTest
Change-Id: I2171ad0b6fcad6c79b480582437fe1c0fd3df3b5
2021-03-18 16:17:01 +00:00
lucychang
b98a658c27 Prompt notifications for non-accessibility services
Prompts a notification for the non-accessibility category service after
24 hours enabled to alert users the service has powerful permissions to
view and control the device. And the notification won't be resend to
the same service by saving the dismiss record to Settings.

Bug: 176965357
Test: atest AccessibilitySecurityPolicyTest
      atest PolicyWarningUIControllerTest
      and manually test

Change-Id: Id5daf7b14dc88cf3f71a53f46fa9a8f1dee91822
2021-03-18 03:01:10 +00:00
Songchun Fan
cd9ae13846 Merge "[settings] Remove @Readable for hidden fields added in S" into sc-dev 2021-03-18 00:55:44 +00:00
Songchun Fan
2a9a33830d [settings] Remove @Readable for hidden fields added in S
This protects newly added fields from being accessed outside
system_server or system/privileged apps.

BUG: 175024829
Test: atest android.appsecurity.cts.ReadableSettingsFieldsTest
Change-Id: I40fda59c164a5982e811d51a69dc9aa8365b04d1
2021-03-17 18:51:07 +00:00
Yomna Nasser
1de59a9c59 Implementation of "Enable 2G" for Settings.
(1) Adds KEY_HIDE_ENABLE_2G_BOOL to CarrierConfigManager, and
(2) Adds new reason ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G.

Test: manual & atest -c Enable2gPreferenceControllerTest
Bug: b/163168917
Change-Id: I81052549f8dde491697c35365320145fd24c3842
Merged-In: I81052549f8dde491697c35365320145fd24c3842
2021-03-17 20:21:21 +08:00