943 Commits

Author SHA1 Message Date
Jesse Evans
93b7acddf8 Merge "Rename WEB_ACTION_ENABLED to INSTANT_APPS_ENABLED" into oc-dev am: 684b5381e9
am: 3d1676cfc4

Change-Id: I0cc0d165ad5bceb1d93cbe48030e347b53e3caf4
2017-04-12 21:35:09 +00:00
Jesse Evans
fc1bfc442c Rename WEB_ACTION_ENABLED to INSTANT_APPS_ENABLED
Renames the instant apps setting to reflect what it is for.

Adds the SystemApi annotation to make this field visible
to the resolver and installer.

Test: existing tests

Change-Id: I1651bb101d69bdfdaa63c004435025c68a33cd8e
2017-04-12 07:00:51 -07:00
Christopher Tate
6bf9c37de0 Merge "Don't call the Package Manager when holding the settings lock" into oc-dev am: 781fdfaf5b
am: 36d12d4408

Change-Id: Idf3c030fe1e7e3a262b6b883249619358761e888
2017-04-06 02:53:47 +00:00
TreeHugger Robot
781fdfaf5b Merge "Don't call the Package Manager when holding the settings lock" into oc-dev 2017-04-06 01:41:51 +00:00
Christopher Tate
b218e768f8 Don't call the Package Manager when holding the settings lock
The package manager sometimes has to call into the settings provider with
its own lock held in the course of processing queries, so it's vitally
important not to call into it with the settings provider's internal lock
already held.

In this case, the SSAID lazy-generation path was fetching the signatures
of the calling package from inside the settings lock.  Now it doesn't.

Bug 36863412
Test: manual

Change-Id: Ic9d53397b5bddb883c5d73aff253ca280a5e93c0
2017-04-05 17:01:12 -07:00
Felipe Leme
a728bd47b6 Merge "Adds a config for default autofill service." into oc-dev am: 045c71f1be
am: 87440e9c84

Change-Id: I0ff34bac471e5b46bee056db8bd8586a06e6f792
2017-04-05 02:06:35 +00:00
Felipe Leme
ff35509ee9 Adds a config for default autofill service.
Change-Id: I4d2d8637617439c5df3f62426e9bc45a78edc2e3
Fixes: 35708268
Bug: 36790693
Test: manual verification
2017-04-03 17:51:26 -07:00
TreeHugger Robot
74eb2d6d74 Merge "Add test config to SettingsProviderTest" 2017-03-31 23:54:34 +00:00
Stephen Chen
5d0922f78a Enable Wifi Wakeup Setting by default.
Bug: 36385983
Bug: 32913119
Test: runtest --path frameworks/base/core/tests/coretests/src/android/provider/SettingsProviderTest.java
Change-Id: I99f9aea6f85675eb1c92fe16f99755117110636a
2017-03-27 13:02:57 -07:00
Guang Zhu
71934ecb19 Revert "Enable Wifi Wakeup Setting by default."
Bug: 36385983
Bug: 32913119
Bug: 36604943

This reverts commit abb947ac24b316a188965c341599973a1f7a3de9.

Change-Id: I484534dd6c24f5b2c2839781fc6a71d9e976a859
2017-03-25 02:26:24 +00:00
Stephen Chen
abb947ac24 Enable Wifi Wakeup Setting by default.
Bug: 36385983
Bug: 32913119
Test: runtest --path
frameworks/base/core/tests/coretests/src/android/provider/SettingsProviderTest.java

Change-Id: Ia9205d28d7c215fd8c407560513036565e36537d
2017-03-24 10:35:21 -07:00
Amith Yamasani
3945202dc8 Some logging for settings reset
If settings db gets reset because it disappeared/got corrupted,
then write the Build.ID of the OTA, so we know when it was reset.

Bug: 36365648
Test: manual
Change-Id: I499a7f65f07a61c0e4651dbd046fc5b16408c09d
2017-03-23 17:43:39 -07:00
Dan Shi
52d5386194 Add test config to SettingsProviderTest
Details about test configs changes are tracked in doc
https://docs.google.com/document/d/1EWUjJ7fjy8ge_Nk0YQbFdRp8DSHo3z6GU0R8jLgrAcw/edit#

Bug: 35882476
Test: local test

Change-Id: I01a7338a6b4ed8b617c843b364ffe443cc202c2e
2017-03-22 20:51:59 -07:00
Makoto Onuki
73360ab2d1 Fix deadlock between activity manager and settings provider
Test: manual
Bug 36028906

Change-Id: I20344608d79d174b468506056789c04d3bde510f
2017-03-17 11:59:45 -07:00
Chad Brubaker
67383eda56 Merge "Expose settings provider to Instant Apps" 2017-03-15 18:11:59 +00:00
Donghyun Cho
c1fa9afbcd CEC: Revisit the behavior of HDMI_SYSTEM_AUDIO_ENABLED
Currently the system setting, HDMI_SYSTEM_AUDIO_ENABLED, is used to
store the latest system audio mode status so that TV can keep this
status over reboot. But because the name is a little confusing and the
behavior isn't intuitive, it is likely to use this in a wrong way.
This change renames this setting to HDMI_SYSTEM_AUDIO_CONTROL_ENABLED
and tweak the purpose of it. Now, it will act more like a switch for
System Audio Control feature, so user can disable or enable this feature
entirely. With this way, implementation of audio output option will
also become easier.

Bug: 31449672
Test: Tested on archer
Change-Id: Ice8717135272d4b86665a3452bfe7527c0d6c08b
(cherry picked from commit 7b7aa8fb31ccf0cd3f36162a52f080263dd89e77)
2017-03-13 20:00:58 +09:00
TreeHugger Robot
a3b642a854 Merge "Always use calling uid for package lookup." 2017-03-10 22:43:10 +00:00
Chad Brubaker
5bd21e9184 Expose settings provider to Instant Apps
Provider enforcement is not yet in, but the settings provider is needed
so expose it now.

Test: Builds
Change-Id: I9afffb45043220e4b85778bbd4f5c4143831fc74
2017-03-09 13:07:36 -08:00
Chad Brubaker
f0fa8534c6 Always use calling uid for package lookup.
Change-Id: I61949aa4a261d6cd18d7c9878a29dc40364afac0
Fixes: 35656125
Test: `adb shell settings list global`
2017-03-09 12:46:44 -08:00
Felipe Leme
640f30a776 Replaced auto-fill by autofill to keep it consistent with API style.
This change will affects 2 types of apps: autofill service implementations
and apps that use autofill APIs.

Since just the former is known to be used at the moment, we're not trying
to keep backward compatibility with the latter.

Bug: 35956626
Test: CtsAutoFillServiceTestCases pass
Test: android.provider.SettingsBackupTest pass

Change-Id: Ia720083508716deae9e887f9faa7ae7c5a82f471
2017-03-09 08:14:49 -08:00
Svetoslav Ganov
e83df48908 Avoid cross lock acquisition leading to deadlocks
Test: manual

bug:36007738

Change-Id: I3db09af07857435682754916849433a809547974
2017-03-08 17:32:42 -08:00
Alex Klyubin
1991f57230 Restrict access from apps to bluetooth_address setting
BluetoothManagerService for some reason leaks the Android's Bluetooth
MAC address via Settings.Secure which is normally readable by all
apps. This lets apps bypass the restriction on access to Bluetooth MAC
address from apps.

This commit fixes the issue by restricting access to bluetooth_address
secure setting (Settings.Secure). Only packages which hold the
android.permission.LOCAL_MAC_ADDRESS permission retain access.

This commit accordingly grants LOCAL_MAC_ADDRESS permission to the
system Shell app because a number of scripts (including Android CTS)
use "adb shell settings get secure bluetooth_address" as a convenient
way to query the device's Bluetooth MAC address over ADB. This is
acceptable because the user of the device can see the Bluetooth MAC
address and thus it's fine for shell to be able to see the address as
well.

Test: See CTS test added in the cts project in this topic.
Test: "adb shell settings get secure bluetooth_address" returns the
      Bluetooth MAC address of the Android.
Test: "adb shell settings list secure | grep bluetooth_address"
      returns the Bluetooth MAC address of the Android.
Test: Bluetooth works (toggling off/on, pairing, file transfer)
Bug: 33701414

Change-Id: I17b110b96eb3794b25c1661e93d29a7a003e3c9a
2017-03-03 14:25:14 -08:00
Svet Ganov
480b570603 Add a missing write lock to settings state.
Atomic file requires sync between writers otherwise we may end
up with partially written settings file and no backup to recover.

Test: not testable by how we hold a mutex

bug:35915719

Change-Id: I97eebf869fa7e4989dcd2a29e4418c22706edcb8
2017-03-03 03:01:34 +00:00
Svetoslav Ganov
28a7194d25 Merge "Ensure default and system set bits grandfathered" 2017-02-23 21:03:44 +00:00
Svet Ganov
137015599e Ensure default and system set bits grandfathered
We added the notion of a default and whether the system set
the setting. This is used for resetting the internal state and we need
to make sure this value is updated for the existing settings, otherwise
we would delete system set settings while they should stay unmodified.

Test: manual

bug:35317326

Change-Id: Iaffde2e7acab53653fd38e669a644e654cc7cd7d
2017-02-23 12:58:13 -08:00
TreeHugger Robot
798cccb659 Merge "Don't copy ringtones when profile sync goes off" 2017-02-23 04:21:39 +00:00
Robin Lee
7af9a74431 Don't copy ringtones when profile sync goes off
Experimentally, it makes more sense to more people to have the parent
setting as an overlay not a concrete thing.

Test: make cts -j30 && cts-tradefed run cts --module CtsDevicePolicyManagerTestCases --test 'com.android.cts.devicepolicy.ManagedProfileTest#testRingtoneSyncAutoDisableRingtone' </dev/null 2>&1
Bug: 34730524
Change-Id: I5f804713def9e54921b90e4f5cea742ba8aaa685
2017-02-23 02:47:24 +00:00
Julia Reynolds
ad0d9e0157 Grant notification listener access to overlay pkgs
Test: manual
Change-Id: I935b701507cd8eafec991b03ac67364e9830d757
2017-02-22 10:00:28 -05:00
TreeHugger Robot
fb924fa981 Merge "Fix 'Modifying dpm.setSecureSetting call for install_non_market_apps'" 2017-02-22 05:37:37 +00:00
Suprabh Shukla
0b1356ff1f Fix 'Modifying dpm.setSecureSetting call for install_non_market_apps'
The previous change was reverted as it broke work profile provisioning.
Clearing binder calling identity before calling into settings provider
should fix the issue.

Test: runtest managed-provisioning
Test: runtest -x services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Test: Manually tested that work profile is inflated with expected values
of install_non_market_apps

Bug: 33947615
Bug: 35590590

Change-Id: I3c31a73fef0c25c0e682e18f637272adad39b28d
2017-02-21 18:36:28 -08:00
TreeHugger Robot
d2876544fb Merge "Deprecate "speak passwords" setting." 2017-02-22 01:57:45 +00:00
Phil Weaver
385912ee2d Deprecate "speak passwords" setting.
This will now be controlled by individual accessibility services.
We'll provide the password information to them, and they can
present or hide the information as it makes sense for their users.

Password information was anyway provided when a headset was
connected.

Bug: 28139568
Test: Manually verified that TalkBack now speaks passwords on the
lock screen and in text views. Since I'm removing functionality
that didn't have tests, it's tricky to have specific tests.
Change-Id: Ic3c724ccce5762ee9dcd9e7dcbd4eae6734dd05e
2017-02-21 15:24:54 -08:00
Svetoslav Ganov
cac64f616f Handle location enabled setting null value
We have the notion of a null value object whose internal
value is null. If it happens that the setting was never
populated we get back the null object whose value is null
and the code does not expect null and crashes.

bug:35368238

Test: manual

Change-Id: I02c3771b94a45b4ee53e2141711eed134542ea0c
2017-02-21 13:28:04 -08:00
Chad Brubaker
3ed1b905c4 Merge "Use requesting userId for ApplicationInfo lookup" 2017-02-20 19:50:38 +00:00
Victor Chang
5663e05109 Revert "Modifying dpm.setSecureSetting call for install_non_market_apps"
This reverts commit 2e7d6d64b9b16ea27634bc0e8843717a465142b4.

Bug: 35590590
Fix: 35590106
Test: runtest managed-provisioning
Test: manual verified that work profile can be inflated
Change-Id: Ie780b94053e65bca2f96b32055937c0c9e8beae8
2017-02-20 17:00:58 +00:00
Chad Brubaker
7fe0a5ac56 Use requesting userId for ApplicationInfo lookup
Change-Id: I4f29f31e48d66d16181fb415fd864de2746def94
Fixes: 34771610
Test: runtest --path
frameworks/base/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java
2017-02-18 12:14:02 -08:00
TreeHugger Robot
dd903d4f0e Merge "Modifying dpm.setSecureSetting call for install_non_market_apps" 2017-02-17 23:05:48 +00:00
Suprabh Shukla
2e7d6d64b9 Modifying dpm.setSecureSetting call for install_non_market_apps
Starting from O, install_non_market_apps is deprecated and will not be
checked by the package installer. Device admin apps should be using the
user restriction instead.
Since on managed profiles, the default value blocked install from
unknown sources, the system will set the user restriction on behalf of
the profile owners (if the profile has one).
For non-managed profiles, the user had access to the settings to change
the value of install_non_market_apps. So going forward, any request to
change it's value by dpm#setSecureSetting in such users is going to be
ignored.

Test: Manually tested that:
1. For a profile with PO, when install_non_market_apps was set to 0,
user restriction is set on upgrade
2. For a profile with PO, when install_non_market_apps was set to 1,
user restriction is not set on upgrade
3. After upgrade, newly created managed profiles with PO have user
restriction set

Bug: 33947615
Change-Id: I063e9ee608b52086ffdf8ed2b24e2928574c58cd
2017-02-17 13:25:14 -08:00
Todd Kennedy
be0b8896d1 Revert "Revert "Per user setting for instant app""
This reverts commit be9ffa15af9e1906e9ffb505768328d62d4a3793.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: Ib21321cf157a79890de487060a093840f7182047
2017-02-16 12:43:37 -08:00
Jeremy Joslin
27d14c46a7 Define a new config key for the recommendation provider app.
Created a new config key and removed the previous key that
was defined in default.xml. Also removed the SettingsProvider logic
as we'll set the default in NetworkScoreService in a follow-up CL.

Bug: 35095406
Test: build and install.

Change-Id: I2893be31fd526af8a66d6d1b7d8978adf7e32c0f
2017-02-15 16:51:15 -08:00
Guang Zhu
be9ffa15af Revert "Per user setting for instant app"
Bug: 35390781

This reverts commit 2f5811dcfd840e149851a9333e27ef3cdddf7a46.

Change-Id: Ibb1c8dacbdc6908fc7fa2bc5dca664f2455162bf
2017-02-15 21:43:48 +00:00
Todd Kennedy
2f5811dcfd Per user setting for instant app
The same application can run as either an instant app or an installed
app. Store this setting per-user instead of based upon the install
location.

Bug: 25119046
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: Iff565bb1ac10d631499f0bd0f69b401cb073c10e
2017-02-14 13:42:01 -08:00
TreeHugger Robot
c6ba07d3b6 Merge "Remove downloads backup related Settings." 2017-02-09 22:33:52 +00:00
Jeremy Joslin
c9eb3c4651 Add a new setting to store the network recommendation app.
Test: manual
Bug: 35095406
Change-Id: I3d0b7f3b977c0862969d61a4e46f12151eb15417
2017-02-09 08:43:19 -08:00
Suprabh Shukla
11015dd446 Merge "Deprecating secure setting install_non_market_apps" 2017-02-08 01:53:28 +00:00
Daniel Nishi
c12a9bd148 Remove downloads backup related Settings.
Bug: 32338407
Test: Coretest doesn't fail
Change-Id: Idc28db30af9228e57c6bc775a15d703fbe25798a
2017-02-07 17:49:41 -08:00
Suprabh Shukla
e3745eed8b Deprecating secure setting install_non_market_apps
Apps targetting Android O or higher should use the new api
canRequestPackageInstalls in package manager. The secure setting
INSTALL_NON_MARKET_APPS which was used is set to 1 to make the
change transparent to apps who are already querying for this setting's
value.

Test: adb shell am instrument -e class\
'com.android.providers.settings.InstallNonMarketAppsDeprecationTest' -w\
'com.android.providers.setting.test/android.support.test.runner.AndroidJUnitRunner'

Bug: 33947615

Change-Id: Ie38d130bfccd022483a566270fce071acbdb00b7
2017-02-06 16:08:00 -08:00
Justin Klaassen
5483cea67a Remove experimental twilight-based automatic brightness
Bug: 31602449
Test: verified adaptive brightness no longer varies with twilight with
"brightness_use_twilight" set to "1".

Change-Id: I6b5f7310020b2128c2b292414a205b6052270a0a
2017-02-06 07:36:55 -08:00
Svetoslav Ganov
096d304ae3 Add instant cookie APIs
This change adds APIs for instant apps to store cookie data
that is presisted across instant installs and across the
upgrade from an instant to a standard app. Standard apps
can use the cookie APIs but when they are uninstalled the
cookie is also deleted. The cookies are kept longer than
the instant apps as they are much smaller - 16KB by default.
We can change the cookie size via a system setting i.e.
after we ship we can increase size if needed.

We also add internal APIs to surface information about
installed and uninstalled instant apps which should be
used for showing them in the UI. For this puporse we store
the icon, permissions, and label of uninstalled apps. If
the app is re-installed we drop this meta-data but keep
the cookie around. If we have cookie data stored and the
signing cert of the app changes when it gets re-intalled
we wipe the cookie.

Test: CTS tests pass; hiddent APIs tested manually

Change-Id: If145c0440cc61a5303e2cbb70228d235d36037a5
2017-01-30 17:52:14 -08:00
Svetoslav Ganov
5fb405ba60 Ensure settings provider joins the rescue party
The settings provider has logic to incrementally reset state
in an effort to recover from pushing a bad value putting the
system in a bad state. The settings provider was not force
persisting its state after a reset so after the reboot we
lost the reset changes. Also while resetting we were also
resetting the package name leading to a promotion of the reset
value to being set by the system. Updated the tests and while at
this added logic to synchronously persist critical settings
such as device provisioned.

Test: All tests pass. Manually tested end-to-end rescue party

bug:34677175

Change-Id: Ib240072df2fa549dae39c301008adf48cdf1573a
2017-01-26 23:24:25 -08:00