Commit Graph

4048 Commits

Author SHA1 Message Date
Jeff Sharkey
dafb17e7eb We really want f_frsize and f_bavail.
It's confusing, but f_bsize is not the value you're looking for; the
real block size is f_frsize.  Fix all those bugs.

Also, the vast majority of clients are interested in the usable
disk space, not including reserved space.

Test: builds, boots
Bug: 36840579
Change-Id: Ib1470389afd49c14cab62282ec1e978ebb2c4791
2017-04-02 23:33:38 -06:00
Dianne Hackborn
a47223f99b Implement issue #36590595: Add ability to associated a ClipData with JobInfo
Yum!

Also needed to have a Context.revokeUriPermission() variant that is sane,
so reasonable CTS tests can be written.

Test: new ClipDataJobTest added.

Change-Id: Ia3135ea788a6e32c971bae7dab3a844d0ef4139c
2017-03-31 10:41:50 -07:00
TreeHugger Robot
bb621fd95c Merge "Update ENSURE_VERIFY_APPS javadoc" into oc-dev 2017-03-30 19:31:23 +00:00
Rubin Xu
9f592dbca3 Update ENSURE_VERIFY_APPS javadoc
Make it clear that now this restriction applies across the whole device,
and is settable by profile owner.

Bug: 31000521
Test: None; just javadoc update
Change-Id: If82d8f4167cf1b77d6e10554f1d96b2d3a2a54a0
2017-03-30 16:47:43 +01:00
Tianjie Xu
ea997a038d Merge "Report the temperature during an OTA update" am: 47c7e7f41a am: 022682a721
am: 998c554463

Change-Id: I12a0f4c5fb768bdaa3a4baa4fa5bd7964b80110e
(cherry picked from commit d580a85b20)
2017-03-29 22:58:55 +00:00
Yifan Hong
d658f1c02b Add HidlSupport.java for utility methods for HIDL.
The old .equals code uses Objects.deepEquals,
which does not handle for, e.g. ArrayList<byte[]>.
Create our own recursive HidlSupport.deepEquals
and deepHashCode method to handle these edge cases.

Bug: 36454147
Test: hidl_test_java
Change-Id: I56dc48985486b561263c260cf43aa90f30d581d0
2017-03-29 13:07:15 -07:00
TreeHugger Robot
76c32a35a9 Merge "Allow apps to process ProxyFDCallback asynchrnously." into oc-dev 2017-03-29 04:41:44 +00:00
Daichi Hirono
812c95d37d Allow apps to process ProxyFDCallback asynchrnously.
Previously callback methods of ProxyFileDescriptorCallback were invoked
on a background thread prepared in the framework. So all methods were
invoked and processed synchronously. This was problem because if it took
time to fetch bytes of one file, operations for other files were also
blocked.

The CL changes ProxyFileDescriptorCallback methods to be invoked on
Handler passed by apps. Now application can prepare a Handler per file
so that one file does not block others.

Bug: 35229514
Test: cts-tradefed run cts -m CtsOsTestCases -t android.os.storage.cts.StorageManagerTest#testOpenProxyFileDescriptor_async
Change-Id: Ibadc4aad4c0373a3da586459a8f775e40288c895
(cherry picked from commit 4f156065c8)
2017-03-29 00:14:16 +00:00
Tianjie Xu
b1b38b322c Merge "improve the format of locale argument when calling recovery" am: 032c7a0a18 am: 1cd3a93288
am: bc0865bc78

Change-Id: I65bc4945d0701ecc10fd41f827c4566dfea912f9
(cherry picked from commit ee45a1f3ab)
2017-03-28 22:25:10 +00:00
Makoto Onuki
9957151661 Log a warning if a dispatch on UiThread takes more than
a certain amount of time.

Bug: 34961340
Test: Boot and launch several apps.
Change-Id: I38bd85a1dd9c572242d04f550df4a979f5f3bea5
2017-03-28 21:49:51 +00:00
Torne (Richard Coles)
0452670374 Support loading a stub WebView using a donor package.
Support loading a WebView package which specifies the name of a "donor"
that provides missing files. This allows a preinstalled stub WebView to
function by loading its code and assets from the preinstalled Monochrome
implementation, as long as the versions are close enough that the
manifest contents are compatible, which should be fine since
preinstalled versions will match.

To do this, we replace the stub's code paths in AppplicationInfo with
the donor's, so that all Java and native code and resources are loaded
from the donor APK at runtime instead of from the (mostly empty) stub.

To get the ClassLoader with the modified path cached as if it was the
regular path, we introduce a new "cacheKey" parameter in
ApplicationLoaders.

Bug: 21643067
Test: build "new" stub WebView upstream in chromium and test loading
Change-Id: I08cc9122b1c9def3e1206974f3e0e8973cca3419
2017-03-28 16:21:10 +00:00
TreeHugger Robot
5e01870015 Merge "Unbind from service on app killed and dedup association requests" 2017-03-27 18:43:37 +00:00
Jeff Sharkey
72ba815ca4 Merge "Add a new "virtual disk" feature." 2017-03-27 15:22:52 +00:00
Jeff Sharkey
e53e2d9576 Add a new "virtual disk" feature.
It's extremely difficult to test storage related logic on devices
that don't have physical SD card slots.  So to support better
debugging and testing, add a new "virtual disk" feature which mounts
a 512MB file through loop device.

Also move ParcelFileDescriptor.open() over to using Os.open() so
that it gets StrictMode treatment.

Bug: 34903607
Test: builds, boots, virtual disk works
Change-Id: I072a3a412cfcc8a2a3472919b7273a1ed794fd98
2017-03-25 23:26:21 -06:00
TreeHugger Robot
cb34b96796 Merge "Collect background stats: bluetooth, wifi, sensors" 2017-03-24 23:04:07 +00:00
Eugene Susla
a38fbf63fd Unbind from service on app killed and dedup association requests
1. Listen to calling package binder death stopping the scanning on that.
2. Don't restart scanning when a request with the same values was made.

Bug: 30932767
Test: 1.:
  - Using a test app start scanning and kill the app.
  - In debug mode ensure that DeviceDiscoveryService#stopScan gets triggered
2.:
  - Start scanning and rotate the device while device chooser is visible
  - Ensure no visible loss of state is happening
Change-Id: If126a2c963da90172a956fbd88e6b3dcd7ac8b01
2017-03-24 14:03:17 -07:00
TreeHugger Robot
0795bf8d62 Merge "Hook up data saver to battery saver." 2017-03-24 04:55:15 +00:00
TreeHugger Robot
f2c4c0a08b Merge "Fixes attestation id gathering from secondary android user" 2017-03-23 23:00:25 +00:00
TreeHugger Robot
350948e9d7 Merge "Hide Parcel#readSparseIntArray and Parcel#writeSparseIntArray" 2017-03-23 22:36:59 +00:00
Adam Lesinski
205656d31f Hide Parcel#readSparseIntArray and Parcel#writeSparseIntArray
They were added for a CL that later stopped using them, so there
is no current need for them in public API.

Bug: 35812784
Change-Id: I2a9a30bee65894235f2cc81ab1bd5a37c9296c02
Test: build succeeds
2017-03-23 13:38:26 -07:00
Janis Danisevskis
6ab9bb68ba Fixes attestation id gathering from secondary android user
When Keystore attempts to gather the application attestation
ID for an app that runs not as the primary user/owner of the
device, the PackageManager would deny package manager access
to the required PackageInfo on the grounds that the request
came from a different user
(violates android.permission.INTERACT_ACROSS_USERS)

This patch adds an additional check to
KeyAttestationApplicationIdProviderService, that verifies the
caller is indeed Keystore. Then it drops the caller context
and retrieves the requested PackageInfo, before restoring
the calling context.

Bug: 35719178
Test: install APK [1] and run as secondary user

[1] https://drive.google.com/file/d/0BzV-JgYFLSDIRGY1WENncmFMVW8/view?ts=58d3f3e6
Change-Id: I91f93a56d10498e1ee3bdb983c701033594c3e57
2017-03-23 11:20:48 -07:00
TreeHugger Robot
f3d8d3bd58 Merge "Refactor cache behavior from "atmoic" to "group"." 2017-03-23 06:04:55 +00:00
TreeHugger Robot
d45040ffc7 Merge "Added a UserManager.DISALLOW_AUTOFILL restriction." 2017-03-23 04:44:45 +00:00
Jeff Sharkey
b5a35b8181 Refactor cache behavior from "atmoic" to "group".
Using the word "atomic" has too much baggage relating to locking
guarantees, so move to something softer.

Add isQuotaSupported() for CTS tests.

Move CacheQuotaStrategy over to using SparseLongArray, which has a
more efficient memory footprint inside the system server.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
Bug: 35812899, 35684969, 36482620
Change-Id: I894f53e6f3bc76c77d1bb18c51db14833df14a49
2017-03-22 21:33:53 -06:00
Adam Lesinski
615ee4768b Merge "Update IBatteryPropertiesRegistrar.aidl to support force updates" am: 0aae170841 am: e4d926d9af
am: adecfd3e78

Change-Id: I4955b7f35dacd5266a479dc7523e63ed9ea1a527
2017-03-23 01:11:57 +00:00
Adam Lesinski
e4d926d9af Merge "Update IBatteryPropertiesRegistrar.aidl to support force updates"
am: 0aae170841

Change-Id: I8363aab4dbf0690b92988353d9360c713412a0be
2017-03-23 00:48:31 +00:00
Felipe Leme
24d5893b25 Added a UserManager.DISALLOW_AUTOFILL restriction.
bug: 35710740

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.LoginActivityTest#testUserRestriction
Test: cts-tradefed run commandAndExit cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDisallowAutofill_allowed
Test: cts-tradefed run commandAndExit cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.MixedProfileOwnerTest#testDisallowAutofill_allowed
Test: cts-tradefed run commandAndExit cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testDisallowAutofill_allowed

Change-Id: I41b2bf9fe3bc8df627c6650960bd11346c430a7e
2017-03-22 17:20:48 -07:00
jackqdyulei
29c82ab242 Hook up data saver to battery saver.
1. Add globalBatterySaverEnabled in PowerSaveState, which stores
the real battery saver mode, not the one for specific service.
2. Add "mRestrictBackgroundChangedInBsm" and
"mRestrictBackgroundBeforeBsm" to restore the mRestrictBackground
if necessary.
3. If user toggles the data saver when battery saver is on, don't
restore the data saver when battery saver is off.

Bug: 34693888
Test: FrameworksServicesTests
Change-Id: Ic50c1cae3fb110a228e59e5d1fd04c164e4b7274
2017-03-22 15:55:21 -07:00
Adam Lesinski
2392cbd888 Update IBatteryPropertiesRegistrar.aidl to support force updates
Change-Id: Ic4f705a20db32369d106462c47eb150850a3f638
Test: builds
2017-03-22 19:32:43 +00:00
Bookatz
867c0d72af Collect background stats: bluetooth, wifi, sensors
Added background times and counts for an app's bluetooth scans, wifi
scans, and sensor usage. Note that the original times for these three
are pooled (i.e. represent the blame apportioned to an app for using
these, rather than the actual time an app used these). Since background
times are not pooled, and are therefore incomparable to the original
times, an extra time, to represent the actual time, had to also be added
in the form of 'total duration' to which background times can be
compared.

Note that this total duration is now a feature of all DurationTimers and
can be used, e.g., to track actual wakelock time (not just
apportioned wakelock times). The total duration is the time used since
reset, and does not give other 'which' times (such as 'since
unplugged').

Bug: 35679958
Bug: 35677312
Bug: 35673525
Test: runtest -x
frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java

Change-Id: I4b6943f76517cf5cc9420684857a5592cc7495be
2017-03-22 10:18:43 -07:00
TreeHugger Robot
d85bf7857d Merge "Method to allow testing of Loopers" 2017-03-21 23:01:04 +00:00
Jason Monk
5be50f7d29 Method to allow testing of Loopers
Add a wrapper object that provides some control and access to
the package hidden methods on Looper only for the purpose of
testing. Will not work on non-instrumented apps.

Test: none
Change-Id: I55cdfeac17ddc0d251852ab764501544079fc888
2017-03-21 14:24:20 -04:00
TreeHugger Robot
d5e35f98ec Merge "Allocate new UID for OTA update resource tracking." 2017-03-21 17:49:07 +00:00
Jeff Sharkey
07c5c6f7f0 Allocate new UID for OTA update resource tracking.
Recent changes to OTA updates started "blaming" network usage on the
system UID, which makes it difficult to triage incoming bugreports
that claim heavy network usage.  Instead, this change gives OTA
updates an explicit UID to make triage easier.

Test: builds, boots
Bug: 36130264
Change-Id: I541299f83def41cfebc010dd825093467f372e79
2017-03-21 10:09:50 -06:00
TreeHugger Robot
2bcca1d624 Merge "BZZZZZZT! BZZZZZT! New Vibrator APIs" 2017-03-21 13:40:36 +00:00
Eugene Susla
a540460e7b Merge "Register PackageMonitor for CompanionDeviceManagerService" 2017-03-20 23:04:16 +00:00
Eugene Susla
6a7006a968 Register PackageMonitor for CompanionDeviceManagerService
1. On package removed -> remove all its associations
2. On package updated -> if had associations, update special access permission
in accordance with (potentially changed) permission entries in manifest

Bug: 30932767
Test: 1. Remove app, and ensure xml entries for it got removed.
2. adb install new version of app without special permissions in manifest, and
ensure whitelist removal method got called
Change-Id: I87261c05ddcf40a18332d160b44ee2f8284df5e4
2017-03-20 13:38:58 -07:00
Michael Wright
7121697a5e BZZZZZZT! BZZZZZT! New Vibrator APIs
Replace the existing Vibrator APIs with a new class to encapsulate the
haptic effect information, and add the ability to control the vibration
strength.

Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.VibratorTest
      cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.VibrationEffectTest
      runtest systemui-notification
      Manual testing with $T/google_experimental/users/michaelwr/Vibrator

Bug: 30961353

Change-Id: Idbb9864a7b084c85e7b7de3257a0e6b40d9d91d6
2017-03-20 16:09:51 +00:00
TreeHugger Robot
ef8297e275 Merge "Send broadcast when user restrictions change." 2017-03-17 20:48:36 +00:00
Jeff Sharkey
f5299f1b88 Disable large-ish parcel logging.
This logging was originally added to track down very large log
messages that were causing Binder transactions to fail.  We fixed
a handful of bugs that could have been causing this over in 32575987,
so this logging should no longer be needed in live builds.  (In fact,
this logging is being triggered often enough to push other important
debugging information out of logs.)

Test: builds, boots
Bug: 36372780
Change-Id: I640192fbec35693673a2f22b7a82ce54f27937da
2017-03-17 10:25:10 -06:00
Makoto Onuki
e72f81b64d Send broadcast when user restrictions change.
- Send UserManager.ACTION_USER_RESTRICTIONS_CHANGED, which is a runtime receiver
only broadcast.

Bug 36355208

Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsDevicePolicyManagerTestCases -t 'com.android.cts.devicepolicy.UserRestrictionsTest#testUserRestrictions_deviceOwnerOnly'
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsDevicePolicyManagerTestCases -t 'com.android.cts.devicepolicy.UserRestrictionsTest#testUserRestrictions_primaryProfileOwnerOnly'
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsDevicePolicyManagerTestCases -t 'com.android.cts.devicepolicy.UserRestrictionsTest#testUserRestrictions_secondaryProfileOwnerOnly'
Change-Id: Ifd82e39ce2c08ed5accdf017f4a1ea3af6face63
2017-03-16 15:51:11 -07:00
Martijn Coenen
d45b626e2b Merge "Add HwParcel::releaseParcel()" am: 210b9afe64 am: cea6624ffa
am: 388af9c9db

Change-Id: Idadca897d444807dbb037eee33d8485717ceaae3
2017-03-16 19:53:49 +00:00
Martijn Coenen
cea6624ffa Merge "Add HwParcel::releaseParcel()"
am: 210b9afe64

Change-Id: If08cb12187e9694144d5c07d9f6fcd67142b8af9
2017-03-16 19:42:45 +00:00
Martijn Coenen
210b9afe64 Merge "Add HwParcel::releaseParcel()" 2017-03-16 19:35:58 +00:00
Martijn Coenen
3d726d16b6 Add HwParcel::releaseParcel()
To be able to free native Parcel objects as soon
as a transaction is done.

Test: hidl_test_java
Bug: 36088202
Change-Id: I50b3eb7e9fe06958c64575923730d3467e73b9a5
2017-03-16 17:58:22 +00:00
Elliott Hughes
ec50f7031c Merge "Restore SystemProperties.PROP_NAME_MAX to keep Kindle running." am: ef9c425416 am: 40c4210f8f
am: 5c8e3edf48

Change-Id: I4fbdbbb12b7854fcca22de2790c14d315ef44c53
2017-03-16 05:50:23 +00:00
Elliott Hughes
40c4210f8f Merge "Restore SystemProperties.PROP_NAME_MAX to keep Kindle running."
am: ef9c425416

Change-Id: I0ea94267a6d6cfa137e77edde288632d04a71bcd
2017-03-16 05:40:47 +00:00
Kweku Adams
134c59bb40 Renaming the second active event to avoid confusion.
BUG: 23532995
Test: make -j 32 ...

Change-Id: I8d44e98520f40f46727cb57ba77932eee2b1b0ea
2017-03-16 00:33:33 +00:00
Elliott Hughes
70cfefa01a Restore SystemProperties.PROP_NAME_MAX to keep Kindle running.
The limit has been lifted in O, but without this constant, Kindle crashes here:

  Caused by: java.lang.NoSuchFieldException: PROP_NAME_MAX
    at java.lang.Class.getField(Class.java:1607)
    at com.amazon.android.webkit.AmazonWebKitFactories$Implementation.<clinit>(AmazonWebKitFactories.java:59)

The code seems to want to truncate a system property name to avoid the
exception that SystemProperty.get threw if passed a name that was too long.

Bug: http://b/36095274
Test: select a word in Kindle
Change-Id: Id1881a8a7c6386400a1024beb0d1b741bdaefba7
2017-03-15 13:01:53 -07:00
Felipe Leme
104b932b7b Fixed obsolete TODOs.
Test: not needed
Bug: 35395043
Bug: 26742218

Change-Id: I0e5adb574610374055a6546b66529a7aed7cc413
2017-03-14 08:41:49 -07:00