943 Commits

Author SHA1 Message Date
Mark Rathjen
8bd8564a18 Merge "Resolve Android security comments for Android ID migration." 2017-01-25 20:20:29 +00:00
Mark Rathjen
7599f1366e Resolve Android security comments for Android ID migration.
- Use 32 byte key instead of 16 byte.
- Use HMAC-SHA256 instead of SHA256 for ssaid generation.
- Update HMAC with all package signatures.
- Use delimiter in between digest arguments.

This change will cause the ssaid of non-legacy installed apps (apps installed
post Android ID migration OTA) to change after an uninstall and reinstall sequence.

Bug: 34395671
Test: Unit tests, CTS tests, Manual tests
Change-Id: I19dec57947368ee5000c2c630b1e4030d46a4ab3
2017-01-23 19:06:41 -08:00
Eugene Susla
d72c39709d Add ability to dump settings as proto buf
Test: Extracted the result via proto bug and as text and compared,
      ran new CTS Setting incident test
Change-Id: Icf7b54b9c5c0a613dfd413ad575001c7b637ca01
2017-01-22 15:25:22 -08:00
Chad Brubaker
6ba5dccd50 Merge "Add ephemeral whitelist for SettingsProvider" 2017-01-20 22:06:58 +00:00
Chad Brubaker
97bccee6d6 Add ephemeral whitelist for SettingsProvider
Currently the list is small, only whats required to launch a basic
ephemeral app. It will expand in followup CLs.

Note that the goal of this is not to completely shut down all ways that
an ephemeral app could learn the value (or part of) of a setting not in
the set. The goal is to limit the raw access to settings to a small set that
includes settings that ephemeral apps should have access to directly
System APIs that are exposed to ephemeral apps may allow for
ephemeral apps to learn the value of settings not in the directly
exposed set and that is OK and _not_ a security issue.

This contains a hack to support code in system system server that in
the process of a binder transaction reads a setting using a
ContentReceiver with a system package name. This was previously not an
issue but causes an exception to be thrown from getCallingPackage which
reading a setting now calls.

Bug: 33349998
Test: Boots, functions as normal for regular apps.
Test: cts-tradefed run cts -m CtsProviderTestCases -t
android.provider.cts.SettingsTest

Change-Id: Icc839b0d98c725d23cdd395e8cb76a7b293f8767
2017-01-20 11:03:53 -08:00
Mark Rathjen
2ce3bf3ed7 Merge "Fix NPE in SettingsProvider." 2017-01-19 20:12:24 +00:00
Mark Rathjen
ea617597c7 Fix NPE in SettingsProvider.
Bug: 34387347, 34396959, 34395671
Test: CTS tests passed, Manual testing passed
Change-Id: I333dfba05f9a4706af22b850b8a010cf391350fc
2017-01-18 23:03:41 -08:00
Mark Rathjen
c45df0d7c1 Merge "Roll forward SSAID Migration to be Per App/User Unique Values." 2017-01-19 04:21:47 +00:00
Mark Rathjen
d891f01d96 Roll forward SSAID Migration to be Per App/User Unique Values.
SSAID is currently shared across all applications for each
user on the device, giving developers the ability to track
users across multiple applications. Using SSAID for tracking
is an abuse of the original intention of the SSAID and has
inherent privacy concerns.

This change will make the SSAID unique per application, per
user on a device. To not affect applications installed prior
to this change they will retain the legacy SSAID value until
uninstalled and reinstalled again.

Across subsequent installations the application will receive
the same SSAID as long as the package name and signature remain
consistent.

Tested manually the following cases:
  - App retains the legacy sssaid after OTA.
  - App gets a new ssaid upon post-OTA installation.
  - App retrieves same ssaid across post-OTA unistall/reinstalls.
  - Different Apps receive different ssaids.
  - Factory reset removes ssaid data and generates a different
    ssaid after App install.
  - System retains legacy ssaid.

Bug: 34395671
Test: CTS tests passed, Manual testing passed

This reverts commit be43257005d086ff7d93c15dae22ac40bc0d545e.

Change-Id: Ibf20e7949304c30d65bb8aa24cdbbe6e104b1002
2017-01-19 04:10:37 +00:00
Mark Rathjen
5256e0556b Merge "Revert "SSAID Migration to be Per App/User Unique Values."" 2017-01-19 00:25:50 +00:00
Mark Rathjen
be43257005 Revert "SSAID Migration to be Per App/User Unique Values."
This reverts commit 5514fb7aba781d8eabbbfc27a5d27a6b3a447b40.

Change-Id: I0d6b9b9ef3ecda3b7ec1b7160c492ec16c65b125
2017-01-18 23:08:48 +00:00
Paul Duffin
8aeb59ebcd Prepare for removal of legacy-test from default targets
In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.

Bug: 30188076
Test: make checkbuild
Change-Id: I13e88297731253420e4e5f5291d503f13a39a156
2017-01-18 16:39:34 +00:00
Mark Rathjen
8bd15d1df2 Merge "SSAID Migration to be Per App/User Unique Values." 2017-01-17 23:57:17 +00:00
Mark Rathjen
5514fb7aba SSAID Migration to be Per App/User Unique Values.
SSAID is currently shared across all applications for each
user on the device, giving developers the ability to track
users across multiple applications. Using SSAID for tracking
is an abuse of the original intention of the SSAID and has
inherent privacy concerns.

This change will make the SSAID unique per application, per
user on a device. To not affect applications installed prior
to this change they will retain the legacy SSAID value until
uninstalled and reinstalled again.

Across subsequent installations the application will receive
the same SSAID as long as the package name and signature remain
consistent.

Tested manually the following cases:
  - App retains the legacy sssaid after OTA.
  - App gets a new ssaid upon post-OTA installation.
  - App retrieves same ssaid across post-OTA unistall/reinstalls.
  - Different Apps receive different ssaids.
  - Factory reset removes ssaid data and generates a different
    ssaid after App install.
  - System retains legacy ssaid.

Bug: 30979321
Test: CTS tests passed, Manual testing passed
Change-Id: I4acc190c14ec249e6365e05e7943148ed6f17f71
2017-01-17 11:22:07 -08:00
Roozbeh Pournader
b84a505b62 Rename language+country resources to just language
Bug: 26496609
Test: none
Change-Id: I40b99a8728f1f324f4c1f8066a61c3d5f92b1ac6
2017-01-10 23:51:26 -08:00
Svetoslav Ganov
0b1501a7c8 Warn makeDefault ignored for system settings only if true
Test: changed system setting and got it back without a warning

bug:33816118

Change-Id: I4e185b46467fc885d2bafedbcbdf41354d0fa9d8
2017-01-04 17:12:03 -08:00
TreeHugger Robot
4799fce7b0 Merge "Remove unused ro.com.android.wifi-watchlist" 2016-12-28 01:03:02 +00:00
Alex Klyubin
db75666418 Remove unused ro.com.android.wifi-watchlist
System property ro.com.android.wifi-watchlist is automatically copied
into Settings.Secure.WIFI_WATCHDOG_WATCH_LIST which has been
deprecated and unused since API Level 16 (if not 14). Neither the
system property not its Settings.Secure counterpart is used anywhere.

This commit thus removes the automatic copying of the system property
into Settings.Secure.

Test: Device boots, Wi-Fi works
Bug: 33700679
Change-Id: If27149b863f41fed6c09b62145d5cfd96ae8e6de
2016-12-27 15:30:40 -08:00
Svetoslav Ganov
ce7daaf982 Fix settings shell command
Test: run shell commands and verified result

Change-Id: I24e87a0efa9330a5872d300e17083d320fcc0573
2016-12-27 15:06:55 -08:00
Svetoslav Ganov
e080da9ee0 Settings recovery support
This change allows the system to perform iterative reset
of changes to settings in order to recover from bad a
state such as a reboot loop.

To enable this we add the notion of a default value. The
default can be set by any package but if the package that
set it is a part of the system, i.e. trusted, then other
packages that are not a part of the system, i.e. untrusted,
cannot change the default. The settings setter APIs that
do not take a default effectively clear the default. Putting
a setting from a system component always makes it the
default and if the package in not trusted then value is
not made the default. The rationale is that the system is
tested and its values are safe but third-party components
are not trusted and their values are not safe.

The reset modes from the least intrusive are: untrusted
defaults - reset only settings set by untrusted components
to their defaults or clear them otherwise; untrusted clear
- clear settings set by untrusted components (or snap to
default if provided by the system); trusted defaults - reset
all settings to defaults set by the system or clear them
otherwise.

Also a package can reset to defaults changes it made to
the global and secure settings. It is also possible to
associate a setting with an optional token which can then
be used to reset settings set by this package and
associated with the token allowing parallel experiments
over disjoint settings subsets.

The default values are also useful for experiment (or
more precisely iterative tuning of devices' behavior in
production) as the stable configuration can be set to
the "graduated" safe defaults and set the values to the
experimental ones to measure impact.

Test: tests pass

Change-Id: I838955ea3bb28337f416ee244dff2fb1199b6943
2016-12-22 01:14:28 +00:00
Jeremy Joslin
8bdad345cc Migrate the NETWORK_SCORER_APP to NETWORK_RECOMMENDATIONS_ENABLED.
If NETWORK_SCORER_APP has a non-null value then enabled
NETWORK_RECOMMENDATIONS_ENABLED.

Test: runtest --path frameworks/base/packages/SettingsProvider/test/src/com/android/providers/settings/SettingsProviderTest.java
BUG: 32913919
Change-Id: Ibea34f0a17539e9c583898dc336f807f92b33c54
2016-12-14 11:54:32 -08:00
Steve McKay
ea93fe7539 Replace ContentProvider SQL args w/ Bundle & Constants.
Test: cts-tradefed run cts-dev -m CtsContentTestCases
Bug: 30927484
Change-Id: Idb9dbc2b80896e9f8474a0db71353b7a3810d597
2016-12-09 12:31:44 -08:00
Svetoslav Ganov
74c9983e80 Fix vulnerability in MemoryIntArray
MemoryIntArray was using the size of the undelying
ashmem region to mmap the data but the ashmem size
can be changed until the former is memory mapped.
Since we use the ashmem region size for boundary
checking and memory unmapping if it does not match
the size used while mapping an attacker can force
the system to unmap memory or to access undefined
memory and crash.

Also we were passing the memory address where the
ashmem region is mapped in the owner process to
support cases where the client can pass back the
MemoryIntArray instance. This allows an attacker
to put invalid address and cause arbitrary memory
to be freed.

Now we no longer support passing back the instance
to the owner process (the passed back instance is
read only), so no need to pass the memory adress
of the owner's mapping, thus not allowing freeing
arbitrary memory.

Further, we now check the memory mapped size against
the size of the underlying ashmem region after we do
the memory mapping (to fix the ahsmem size) and if
an attacker changed the size under us we throw.

Tests: Updated the tests and they pass.

bug:33039926
bug:33042690

Change-Id: Ib8e50afcdb5475123968572ac9696e8ed4031631
2016-12-07 22:43:56 +00:00
Bill Yi
15c50996c1 Merge "Revert "Import translations. DO NOT MERGE"" 2016-12-05 18:40:43 +00:00
Bill Yi
11541ae9a7 Revert "Import translations. DO NOT MERGE"
This reverts commit 6561ccdb9911c8c5d1bd91055cdf5abfcc34e2d9.

Change-Id: I3455557b6d3597a8c6eb626a09cadabed3687ec6
2016-12-05 18:40:10 +00:00
TreeHugger Robot
0e1f49908c Merge "Import translations. DO NOT MERGE" 2016-12-03 09:48:48 +00:00
Bill Yi
6561ccdb99 Import translations. DO NOT MERGE
Change-Id: I20348078648afcf2a154494348d2b55cd3fb2f62
Auto-generated-cl: translation import
2016-12-03 00:17:44 -08:00
Stephen Chen
c837ebb2c1 Merge "Add Settings.Global.WIFI_WAKEUP_ENABLED flag." am: d758ce1586 am: d738140b8d am: a4d7d45df9
am: 50905a474f

Change-Id: Idc7bc3e35343b06adebb035cc00b555db54289c5
2016-12-03 04:35:19 +00:00
Stephen Chen
a4d7d45df9 Merge "Add Settings.Global.WIFI_WAKEUP_ENABLED flag." am: d758ce1586
am: d738140b8d

Change-Id: Icb8eb81b2021ee12eccd9158974353120228e7c0
2016-12-03 04:23:49 +00:00
Stephen Chen
d738140b8d Merge "Add Settings.Global.WIFI_WAKEUP_ENABLED flag."
am: d758ce1586

Change-Id: I1bf1effbb635d57980728555587e8056f630edb9
2016-12-03 04:16:06 +00:00
Stephen Chen
8ca96c1f3c Add Settings.Global.WIFI_WAKEUP_ENABLED flag.
Set the flag default to false. This addition is for the
Android Wi-Fi Snooze project:
https://docs.google.com/document/d/1zewDZ6Ne-qH7zKFDtcSx55f9jPauZwT5VvOs1uVNXf8/edit#

Bug: 32920000
Bug: 32913119
Test: runtest --path
frameworks/base/packages/SettingsProvider/test/src/com/android/providers/settings/SettingsProviderTest.java

Change-Id: I597d5dd643e8044315cc6d7553ae5740485a0552
2016-11-30 18:31:44 -08:00
vinodkrishnan
afd52a7ad4 Revert "DO NOT MERGE Wear Fwk: Disable Animations for A11y"
am: 7b62df8556

Change-Id: I7c8d922fb125bf786990642679ebdd17ba589a54
2016-11-30 21:52:13 +00:00
vinodkrishnan
7b62df8556 Revert "DO NOT MERGE Wear Fwk: Disable Animations for A11y"
This reverts commit 8500f26d51e2ba0de7b6cd18bec5f85e5ca40e1d.

Change-Id: I6408fa3f307d7611443e26b24d3876c1a1f92fdc
2016-11-30 20:09:59 +00:00
Baligh Uddin
b1df48d326 Merge remote-tracking branch 'goog/cw-f-dev' into fix_merger
Bug: 32849428

* goog/cw-f-dev: (98 commits)
  Revert "Catch KeyStoreException for setting profile lock"
  Fix createConfirmDeviceCredentialIntent for wear for CTS.
  Fix default dialog background colour for watch devices.
  Catch KeyStoreException for setting profile lock
  Add cross-links between FINE and COARSE location permissions. bug: 25371600
  Fixed a bug with the emergency affordance in multi user
  Zygote: Additional whitelists for runtime overlay / other static resources.
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Zygote : Block SIGCHLD during fork.
  colors: add missing accent_material_{700,50} resources.
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Zygote : Block SIGCHLD during fork.
  DO NOT MERGE ANYWHERE Revert "DO NOT MERGE ANYWHERE libhwui: make setSurface asynchronous"
  ...

Change-Id: I63468da5bfa21ed9ac5985bbdbf3a61d4c389aa0
2016-11-22 17:19:45 -08:00
Bill Yi
ca112cfaeb Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 32177112
Change-Id: Ia328721b05af6cfe32f4494e89f6ee1645cb1deb
2016-11-20 15:49:28 -08:00
Sudheer Shanka
2250d56a0b Rename MountService to StorageManagerService.
Bug: 30977067
Test: Existing tests pass
Change-Id: Ieac0f11c2b249dcd60441b14c1f391e6f8131d42
2016-11-15 12:43:37 -08:00
Sudheer Shanka
dc589ac82b Update usage of ActivityManagerNative.
- Remove references to ActivityManagerProxy.
- Add isSystemReady to ActivityManager.

Bug: 30977067
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test android.server.cts
      adb shell am instrument -e class com.android.server.am.ActivityManagerTest,com.android.server.am.TaskStackChangedListenerTest \
          -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I07390b6124fb1515821f5c0b37baf6ae74adc8fa
2016-11-14 11:27:12 -08:00
Phil Weaver
a46f009bbf Merge "Add tests for MagnificationController." 2016-11-03 23:11:55 +00:00
Phil Weaver
89e3ffc66c Add tests for MagnificationController.
Also refactoring the class to make it easier to test and
chaning behavior where the current behavior seemed poorly
defined.

Refactoring:
- Combined all handlers into one.
- Simplified animation to use a ValueAnimator.
- Eliminated ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE
  setting. Move rest of settings reading into mockable class.
- Move callbacks from WindowManager into the main class.
- Pulled out my instrumented Handler from the
  MotionEventInjectorTest into its own class so I can reuse
  it.

Behavior changes:
- Always constraining out-of-bounds values rather than
  refusing to change them.
- Constraining offsets on bounds changes. We previously
  left them alone, even if they were out of bounds.
- Keeping track of the animation starting point. We were
  interpolating between the current magnification spec
  and the final one. This change means the magnification
  animates to a different profile.

Test: This CL adds tests. I've also run a11y CTS.

Bugs: 31855954, 30325691

Change-Id: Ie00e29ae88b75d9fe1016f9d107257c9cf6425bb
2016-11-03 13:00:47 -07:00
Dianne Hackborn
32f40ee1a2 Implement Binder shell command for settings provider.
The provider now published a system service, through which you
can do direct shell commands.  The commands are a copy of what
the existing "settings" command does (in a follow-up, that will
be converted to a simple script that calls this).

Also improved a few things in the provider:

- Don't allow implicit creation of settings data for users that
don't exist.
- Improve dump to include the package name that applied each setting
and remove misleading stuff from historical data (and this is now
available through "dumpsys settings" instead of the provider dump).

Test: manual

Change-Id: Id9aaeddc76cca4629d04cbdcbba6a311e942dfa6
2016-11-01 17:25:57 -07:00
Vinod Krishnan
8500f26d51 DO NOT MERGE Wear Fwk: Disable Animations for A11y
- When Accessibility is turned on, Android Wear devices become unusable.
Add an option to disable animations, will be disabled in an overlay.

Bug: 24985771

Change-Id: If5fc44705d56579b305abd48a0d820f306b9be10
2016-10-28 16:56:25 -07:00
Adrian Roos
69741a2eb8 Ambient: If user turned off ambient, keep it off after split
The split ambient settings default to on - which is a bad experience
if the user explicitly turned it off before the split.

Change-Id: I986d35a1a28e97f4c8d7d3d47ed5658e1836a44f
Fixes: 32332195
Test: Flash angler to NYC, disable ambient, upgrade to NYC-MR1, check if "Lift to check phone" is still off.
2016-10-25 12:39:14 -07:00
Adrian Roos
cb60c7a87e Ambient: If user turned off ambient, keep it off after split
The split ambient settings default to on - which is a bad experience
if the user explicitly turned it off before the split.

Change-Id: I346a53b0dc9cdf578c238113f4f33056ba0f3aea
Merged-In: I986d35a1a28e97f4c8d7d3d47ed5658e1836a44f
Fixes: 32332195
Test: Flash angler to NYC, disable ambient, upgrade to NYC-MR1, check if "Lift to check phone" is still off.
2016-10-25 12:37:00 -07:00
Vinod Krishnan
909bbd3117 Fwk: Only chime when docked and accessbility is on am: cf11ceab65
am: ccf3baf6c5

Change-Id: I685dc2ef179087600e4d3c5776448ece338901b7
2016-10-21 21:21:18 +00:00
Vinod Krishnan
ccf3baf6c5 Fwk: Only chime when docked and accessbility is on
am: cf11ceab65

Change-Id: Ief29ef6f325a8248843faa9fbe9ae6ff893a6918
2016-10-21 21:14:19 +00:00
Vinod Krishnan
cf11ceab65 Fwk: Only chime when docked and accessbility is on
Bug: 32036947

Change-Id: I5786abe827735cc3a4bc1d52baacaa19bccaae77
2016-10-21 10:28:37 -07:00
Keun-young Park
ec7a118950 add default overlay for END_CALL_BEHAVIOR
- for automotive, default END_CALL_BEHAVIOR should be 0.
- automotive product should have overlay overriding it.
- default value is the same as now

bug: 31926624
Test: manual (check dumpsys window policy)
Change-Id: Ice7b3c1374dfccf8a03c13c73201fa1615acab5f
2016-10-19 18:54:19 -07:00
Nick Kralevich
44761c81eb Delete "Show CPU usage" am: fc4a5c2d85 am: f0c0188a8a
am: 34547a8dc2

Change-Id: I410846d3ff6856e5f9dee2efd551af8b9d1d94dc
2016-10-11 18:21:32 +00:00
Nick Kralevich
34547a8dc2 Delete "Show CPU usage" am: fc4a5c2d85
am: f0c0188a8a

Change-Id: If33e6687d3ec83904ab6ddbeb008c7b9c8130e7a
2016-10-11 18:15:23 +00:00
Nick Kralevich
f0c0188a8a Delete "Show CPU usage"
am: fc4a5c2d85

Change-Id: I4da784d136601fb3458b8697a0a27a232cd89111
2016-10-11 18:09:10 +00:00