Commit Graph

186 Commits

Author SHA1 Message Date
Sasha Smundak
df848ac224 Convert Android.mk file to Android.bp
See build/soong/README.md for more information.

Bug: 122332340
Test: treehugger
Change-Id: I4ccc0a2e13fc49a0109e9823fbcb4077e11455d5
2019-02-08 15:13:25 -08:00
Bill Yi
37f05ce36b Import translations. DO NOT MERGE
Change-Id: I532c931f8b5eb095d88ad078f2ab1b0ec6cbd0e2
Auto-generated-cl: translation import
2019-02-02 08:14:12 -08:00
Bill Yi
c6a6277534 Import translations. DO NOT MERGE
Change-Id: Iffdeb95a7f885865aee4046e3f2556a675a1fe66
Auto-generated-cl: translation import
2018-09-08 07:40:49 -07:00
Jeff Sharkey
4e7a765855 Clean/destroy app shared storage via installd.
In P we moved destroying per-user shared storage into installd,
where it can iterate quickly over large sets of files.  This change
now moves cleaning/destroying of per-app shared storage data down into
installd, letting us greatly simplify the logic in PMS to no longer
require spinning up DefaultContainerService.  This also fixes an
obscure bug where DCS (which always runs as USER_SYSTEM) wasn't able
to clear shared storage for secondary users.

This also gives us the ability to target specific storage devices
by UUID, such as when the user has migrated their primary shared
storage to an adopted device.

We no longer distinguish between keeping or deleting OBB files
during various operations, since upcoming changes in the Q release
will mean OBB files are no longer shared between users, and they'll
now live inside a sandbox that will be fully cleared when the user
clears data.  (Going forward, apps should be using splits instead
of OBBs, so they're effectively deprecated.)

Uses newer "const" feature of AIDL to ensure constant values remain
consistent between native and Java code.

Bug: 111854851, 111838160
Test: atest android.appsecurity.cts.StorageHostTest#testCache
Change-Id: Ib90be155718a768da76110fbfcf010a471b37378
2018-08-27 20:42:47 +00:00
Dan Willemsen
d00c851e55 Merge "Convert to Soong" am: acbd94d76f
am: b1005a8a2a

Change-Id: If5cb26e0669f79240d8fee1d40aaa2162d8e611f
2018-05-15 15:06:19 -07:00
Dan Willemsen
4888b1f6f0 Convert to Soong
See build/soong/README.md for more information.

Test: m libframeworks_coretests_jni
Test: m FrameworkCoreTests_install
Test: m libshim_jni
Test: m CtsShimPrivUpgrade
Test: m libfilterfw
Test: m PMTest_Java_dual
Test: m libdefcontainer_jni
Test: m libperftestscore_jni
Test: m libpmtest32 libpmtest64
Test: m libprintspooler_jni
Test: m libsmartcamera_jni
Test: m idmap
Test: m libdrmframework_jni
Test: m libdvr_loader com.google.vr.platform com.google.vr.platform.xml
Test: m libfilterpack_imageproc libfilterpack_base
Test: m libwebviewchromium_loader
Test: m shared_mem_test
Test: m test-touchlag
Change-Id: I868561dd237fa28647896d59049ab9260373ada1
2018-05-14 16:47:02 -07:00
Anton Hansson
a3e79fbb8c frameworks/base: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Change-Id: Ibcffec873a693d1c792ca210fb597d2bf37e9068
Merged-In: I4233b9091d9066c4fa69f3d24aaf367ea500f760
2018-02-28 17:15:21 +00:00
Anton Hansson
ab6ec61251 frameworks/base: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Change-Id: I4233b9091d9066c4fa69f3d24aaf367ea500f760
2018-02-28 15:13:23 +00:00
Bill Yi
20f6532a7c Import translations. DO NOT MERGE
Change-Id: I0fd90538d875dc100efdeed1eb21849c49bc2f0f
Auto-generated-cl: translation import
2018-02-22 02:21:36 -08:00
Jeff Sharkey
0095a82b14 Grant DCS storage access; better OBB errors.
DCS had been relying on the WRITE_MEDIA_STORAGE permission to access
OBBs on external storage, but that permission has been locked down,
and we need to use the real WRITE_EXTERNAL_STORAGE permission now.

Rework the OBB error reporting flow to bubble exact error codes up
from internals, so that we can return expected CTS error codes.

Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.storage.cts.StorageManagerTest
Bug: 73424392
Change-Id: Iecbc4132745d56ebf081868ad2f9c3efe1e3735f
2018-02-15 13:06:56 -07:00
Jeff Sharkey
b18f899241 Use sendfile() and splice() to speed up copying.
There are several places across the OS where Java code is simply
copying data between two points, which requires bringing that data
out into userspace before going back into the kernel.  (That's pretty
lame.)  The patches for the recent Meltdown/Spectre security issues
have made this overhead even worse, so it's finally time to move this
copying directly into the kernel.

This change adds a couple new FileUtils.copy() methods which inspect
the given streams/FDs, and attempt to do as much optimization as
possible before falling back to a slower userspace-based copy.

Benchmarks are showing typical improvements of 44% for 32KB files,
50% for 32MB files, and 35% for 32MB pipes.

Plenty of tests are included, and there's a simple kill-switch that
can be used to enable/disable the feature if it starts causing any
trouble.  (A future CL will enable the optimizations.)

Test: bit FrameworksCoreTests:android.os.FileUtilsTest
Test: vogar --mode app_process --benchmark frameworks/base/core/tests/benchmarks/src/android/os/FileUtilsBenchmark.java
Bug: 71932978
Change-Id: I52518d529da5d961610998b9f61399064d8025cd
2018-01-31 21:47:22 -07:00
Dianne Hackborn
3accca05dd Add major version code to platform.
It turns the version code into almost a 64-bit integer, with the
new major part being the upper 32 bits.

The only tricky part about this is the backup manager, since it
stored 32-bit version codes in its backup data sets.  This is dealt
with by, when the major version code is not 0, writing MIN_INT as
the version code and following that by the full long version code,
which we can detect when reading.  Note that this makes backup sets
containing apps with major version codes incompatible with older
versions of the platform.

Bug: 64459786
Test: Added in Change-Id: Iab8a682b62103babd6c16a56b8dc1e97d7078658
Change-Id: Ibfffe235bbfcf358b3741abd3f7197fdb063d3f3
2017-12-04 13:02:10 -08:00
Xin Li
220871a697 Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from
oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.

Change-Id: Ia7b8da4a00d215160e4a4fa40f6044208d1297b7
Merged-In: I19846d2a3ee27aecbae2367a74ee49082eea154d
2017-11-14 12:31:11 -08:00
Jeff Sharkey
1285cfd48f Change storage migration to use quota APIs.
New quota APIs are much faster than trying to measure manually, and
removing this last user of calculateDirectorySize() means we can
remove it once and for all.

(cherry picked from commit c8b29ac6f0)

Bug: 36056324
Test: builds, boots
Merged-In: Ibdf1ee4e8885680e106df6a9269b6309ddc61af8
Change-Id: Ibdf1ee4e8885680e106df6a9269b6309ddc61af8
2017-10-31 09:50:50 -07:00
Bill Yi
c70053e43b Import translations. DO NOT MERGE
Auto-generated-cl: translation import
Exempt-From-Owner-Approval: translation import

Bug: 68003463
Change-Id: I787ed0d86b47ab9e642185523d65cb722479fec0
2017-10-19 20:37:47 -07:00
Jeff Sharkey
f8bb2445ff Finish removing ASEC.
Awhile back we explicitly blocked any new ASEC installs, with the
expectation that we'd eventually remove the logic entirely.  We've
had them disabled for about a week now without incident, so let's
rip out the remaining code.

Test: bit FrameworksCoreTests:android.content.pm.PackageHelperTests
Test: bit FrameworksCoreTests:android.content.pm.PackageManagerTests
Bug: 32913676
Change-Id: I1ecc35487420731f5c4bdf03bca5751548ce51b3
2017-09-28 11:32:57 -06:00
Bill Yi
3c42b8dae5 Import translations. DO NOT MERGE
Change-Id: I53db748a3c15d105f7ad6fa4bfe1797736e21e94
Auto-generated-cl: translation import
2017-08-25 18:24:22 -07:00
Bill Yi
2b4528d049 Import translations. DO NOT MERGE
Change-Id: I338e3a976aad5ee4b31205a22ee579b584363b92
Auto-generated-cl: translation import
Exempt-From-Owner-Approval: translation import
2017-08-11 21:02:53 -07:00
Steven Moreland
2412b4d979 Merge "frameworks/base: use proper nativehelper headers" am: 826eafd958 am: 5c091dc944 am: c840945a78
am: 9f430b2782

Change-Id: Ibe321dd4a8aae9342c76da0780edf94b90e8cd3a
2017-07-20 03:11:00 +00:00
Steven Moreland
5c091dc944 Merge "frameworks/base: use proper nativehelper headers"
am: 826eafd958

Change-Id: I36f10ff4d963284a313f1cc5b368f82549a4adb2
2017-07-20 02:50:53 +00:00
Steven Moreland
2279b25342 frameworks/base: use proper nativehelper headers
libnativehelper exports headers under nativehelper. These were
available before incorrectly as global headers in order to give
access to jni.h.

Test: modules using frameworks/base find headers
Bug: 63762847
Change-Id: I0f9f231acdebe460f279135462f43d3e32eff64d
2017-07-19 10:06:40 -07:00
Jeff Sharkey
c8b29ac6f0 Change storage migration to use quota APIs.
New quota APIs are much faster than trying to measure manually, and
removing this last user of calculateDirectorySize() means we can
remove it once and for all.

Bug: 36056324
Test: builds, boots
Change-Id: Ibdf1ee4e8885680e106df6a9269b6309ddc61af8
2017-07-06 11:29:10 -06:00
Bill Yi
728f7a4f2c Import translations. DO NOT MERGE
Change-Id: Ic9bdbdb26c3c04948374ee9aec9dd855d4d3e9ec
Auto-generated-cl: translation import
2017-06-12 11:52:00 -07:00
Jeff Sharkey
9a4a457622 Clear identity to handle ALLOCATE_AGGRESSIVE.
We're not actually clearing any files, only deciding how much free
space is available, so we're fine assuming the remote caller has the
permission.

Test: builds, boots
Bug: 37169076
Change-Id: I6cd42f77c43e9d2de40e2b8b937c7f2145f1b869
2017-04-14 16:29:04 -06:00
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
Bill Yi
1a83f7e3b0 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 36832302
Change-Id: I87e870cdcec90e173ab587cc65afb8841e9a6411
2017-04-01 21:59:53 -07: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
Bill Yi
cc66f0e165 Revert "Import translations. DO NOT MERGE"
This reverts commit 3703206a9c.

Change-Id: I4c56ddc60e7ebbf82d6d4a3ac792a2580f3ba261
2016-12-05 18:55:03 +00:00
Bill Yi
3703206a9c Import translations. DO NOT MERGE
Change-Id: I62d4bb9e3e6b7bd3c066c5b0df84d6236dcf6f3c
Auto-generated-cl: translation import
2016-12-02 20:36:25 -08:00
Baligh Uddin
6e8cd394b7 Import translations. DO NOT MERGE
Change-Id: Ie2bab11cade0176adb90234c5ad0d38220735e6c
Auto-generated-cl: translation import
2016-04-18 19:57:36 -07:00
Geoff Mendal
7ccd859504 Import translations. DO NOT MERGE
Change-Id: I95a46e04f0b98c68a270560479187a1b1ae54849
Auto-generated-cl: translation import
2016-03-18 19:56:04 -07:00
Jeff Sharkey
78bcc89df4 Merge "Refactoring FBE APIs based on council feedback." into nyc-dev am: a0a58a2
am: 5a128c4

* commit '5a128c4f33aa38d3a35b5884519f6bd3a355512d':
  Refactoring FBE APIs based on council feedback.
2016-03-17 22:09:46 +00:00
Jeff Sharkey
8a372a0a28 Refactoring FBE APIs based on council feedback.
Mostly consists of removing the word "encryption" from most APIs,
since we can't actually make promises about the data being encrypted.

Bug: 27531029
Change-Id: Iace9d7c4e64716abf86ed11847c40f3947e1d625
2016-03-17 14:49:08 -06:00
Geoff Mendal
ef38883269 Import translations. DO NOT MERGE
Change-Id: Ic6029b47a4b6b60432d75eb8fb2f6502afe38c83
Auto-generated-cl: translation import
2016-02-15 05:13:56 -08:00
Geoff Mendal
304f3edaa6 Import translations. DO NOT MERGE
Change-Id: I1dbbcb24ebd0b50cdcd4248e8ed4bd2d439143be
Auto-generated-cl: translation import
2015-12-16 05:22:25 -08:00
Jeff Sharkey
f9fc6d6cc0 More file-based encryption work.
Add granular StorageManager APIs for key creation/destruction and
unlocking/locking.  Start passing through an opaque token as part
of the unlock command, but leave it empty for now.  We now have a
separate "prepare" method that sanity checks that user directories
are correctly setup.

Define a handful of system properties used for marking devices that
should be operating in FBE mode, and if they're emulating FBE.  Wire
a command to "sm", but persisting will come later.

Start using new "encryptionAware" flag on apps previously marked with
coreApp flag, which were apps running in the legacy CryptKeeper
model.  Small tweaks to handle non-encryptionAware voice interaction
services.  Switch PackageManager to consult StorageManager about the
unlocked state of a user.

Bug: 22358539
Change-Id: Ic2865f9b81c10ea39369c441422f7427a3c3c3d6
2015-11-11 10:47:23 -08:00
Geoff Mendal
f0b1b710f8 Import translations. DO NOT MERGE
Change-Id: Ib8bed6df18ef9ce251be4d2dcdfc5ebb5de147aa
Auto-generated-cl: translation import
2015-07-22 05:16:45 -07:00
Jeff Sharkey
38c60b3fcb am 87ef89a2: am 38611265: am 973e7227: am 6819696c: am 539f7ac7: Merge "Give DCS permission needed to measure all users." into mnc-dev
* commit '87ef89a2e5e7163ee24e993c20e263d35bb0b109':
  Give DCS permission needed to measure all users.
2015-07-15 22:57:17 +00:00
Jeff Sharkey
38611265f0 am 973e7227: am 6819696c: am 539f7ac7: Merge "Give DCS permission needed to measure all users." into mnc-dev
* commit '973e72270ccbbd44f6e83690ba32735465bb170d':
  Give DCS permission needed to measure all users.
2015-07-15 22:11:24 +00:00
Jeff Sharkey
973e72270c am 6819696c: am 539f7ac7: Merge "Give DCS permission needed to measure all users." into mnc-dev
* commit '6819696c0e00ce3805de66f13ec6deda2489fd32':
  Give DCS permission needed to measure all users.
2015-07-15 21:59:36 +00:00
Jeff Sharkey
6819696c0e am 539f7ac7: Merge "Give DCS permission needed to measure all users." into mnc-dev
* commit '539f7ac7a195c405987057ef34e88cfbe8eab5e8':
  Give DCS permission needed to measure all users.
2015-07-15 21:43:55 +00:00
Jeff Sharkey
39745ed719 Give DCS permission needed to measure all users.
DCS runs as owner user, but needs to measure details for other users
on the device.

Bug: 22503636
Change-Id: I6d6899fae90c4e92b94647676bda8b88bad412e6
2015-07-15 09:58:37 -07:00
Geoff Mendal
e108e029a6 Import translations. DO NOT MERGE
Change-Id: I048960b16ae88661802cedc4e2f3ae337072da74
Auto-generated-cl: translation import
2015-07-15 05:10:56 -07:00
Geoff Mendal
205becca0a Import translations. DO NOT MERGE
Change-Id: Ie294e23803870c2283b2002f260dc466294e4161
Auto-generated-cl: translation import
2015-07-11 13:37:08 -07:00
Jeff Sharkey
e35360d806 am 67804838: am ccde254c: am 0cae3e9e: am 7dfe0f83: am 7fd3c296: Merge "Permission to view shared storage for all users." into mnc-dev
* commit '67804838150fc85efb1bd27cc68422197976fe3f':
  Permission to view shared storage for all users.
2015-07-07 00:31:00 +00:00
Jeff Sharkey
ccde254cf9 am 0cae3e9e: am 7dfe0f83: am 7fd3c296: Merge "Permission to view shared storage for all users." into mnc-dev
* commit '0cae3e9ebfb5d1050e28f57542eaaaa56fb96a33':
  Permission to view shared storage for all users.
2015-07-06 19:01:41 +00:00
Jeff Sharkey
32e80d7588 Permission to view shared storage for all users.
Typical apps are restricted so they can only view shared storage
belonging to the user they're running as.  However, a handful of
system components need access to shared storage across all users,
such as DefaultContainerService and SystemUI.

Since WRITE_MEDIA_STORAGE already offers this functionality by
bypassing any FUSE emulation, reuse it to grant the "sdcard_rw" GID
which is no longer handed out to third-party apps.  Then we change
the FUSE daemon to allow the "sdcard_rw" GID to see shared storage
of all users.

Bug: 19995822
Change-Id: I504c2a179ba74f142ed0d32da5baa69f4212cd82
2015-07-06 10:54:28 -07:00
Geoff Mendal
88740bcee7 Import translations. DO NOT MERGE
Change-Id: I252366b8b3f6bacf169fb745a9f0b126f3e108f2
Auto-generated-cl: translation import
2015-06-03 10:00:10 -05:00
Geoff Mendal
72878a5753 Import translations. DO NOT MERGE
Change-Id: I2548176e1f01dd7955f765ce8ff6207fd92c9110
Auto-generated-cl: translation import
2015-05-30 19:32:52 -07:00
Geoff Mendal
60fba3c782 Import translations. DO NOT MERGE
Change-Id: I3f5db43cb363a9f7546d25d7046fb44e3711fe60
Auto-generated-cl: translation import
2015-05-21 05:06:56 -07:00