29 Commits

Author SHA1 Message Date
Colin Cross
37d4c0054d Convert frameworks/base/cmds/* to Android.bp
See build/soong/README.md for more information.

Also converts the rest of frameworks/base/tools/streaming_proto.

Bug: 122332340
Test: m checkbuild
Change-Id: I87c500c5464fb1722b4b518d89065f5e1ee29a97
(cherry picked from commit 45c0d71e774c84ec81392393a0fafad398d2838d)
2019-06-06 09:02:46 -07:00
Elliott Hughes
8a741eaecc Merge "Clean up some shell script copy & paste." am: b4012baaf4
am: fda05c96c1

Change-Id: I104862db5d787ffc14512bf1181332c8ca7ba872
2019-05-10 11:22:58 -07:00
Elliott Hughes
5a03b69fc8 Clean up some shell script copy & paste.
Remove apparently meaningless comment that's been copy & pasted all over.

Remove trailing whitespace.

Consistently use "$@".

Inline single-use constant.

Test: treehugger
Change-Id: Ie3b3e285cd35ecff9e6fdb7144fe4bbd04e42452
2019-05-09 22:01:14 -07:00
Jeff Sharkey
68b3e186c2 Remove greylist of apps that gain legacy access.
Per design pivot, access to legacy behavior will be determined by
the new "allowExternalStorageSandbox" manifest flag.

Bug: 124818022, 129487770
Test: atest --test-mapping packages/providers/MediaProvider
Test: atest android.appsecurity.cts.ExternalStorageHostTest
Change-Id: I169e5eb3612c23aad47204cde9ff263f9df6f8c1
2019-04-01 18:48:52 -06:00
Colin Cross
45c0d71e77 Convert frameworks/base/cmds/* to Android.bp
See build/soong/README.md for more information.

Also converts the rest of frameworks/base/tools/streaming_proto.

Bug: 122332340
Test: m checkbuild
Change-Id: I87c500c5464fb1722b4b518d89065f5e1ee29a97
Merged-In: Ieb54feb3902bddfd5a571369fbf50161ae646647
2019-03-29 16:35:06 -07:00
Jeff Sharkey
36274999fe Developer option to disable legacy greylist.
The app developers on the legacy greylist need an option to disable
the greylist so they can debug.

Bug: 124818022
Test: manual
Change-Id: I84785a235830761794dee5c603c1ea43f8ace73e
2019-02-27 12:09:59 -07:00
Jeff Sharkey
b0c363b21e Local and remote isolated storage feature flags.
Moving forward as we start enabling isolated storage in various
dogfood groups, we'll need to maintain separate values for the
feature flag for both "local" and "remote" opinions.  Any strongly
expressed local opinion will always take precidence over any remote
opinion.

Any changes to these feature flags means that we need to invalidate
any PackageManager parsed APKs, since PackageParser changes it's
output depending on the flag state.  Since other feature flags are
likely to need this type of invalidation in the future, define the
PackageManager cache using a SHA-1 hash of a collection of values
that should invalidate the cache.

Bug: 112545973
Test: atest android.os.SystemPropertiesTest
Change-Id: Ifafcdf15e40e694eb4126e06981aeb82df51da33
2018-12-15 18:07:01 -07:00
Risan
f8771d362c Merge "Introducing StubVolume in StorageManager" am: b499af866c am: eb871cc916
am: ee32e0d473

Change-Id: I4098132df9833b7cbac0db9bdadac297d324a822
2018-11-13 12:12:23 -08:00
Risan
05c41e6a0a Introducing StubVolume in StorageManager
Bug: 110380403
Test: Tested in ARC++ (with Settings and vold changes in separate CLS)
- able to see the external storage under StorageSettings. Also tested
the sm command to print stubvolumes.

Change-Id: I7517260a40399bd9800424bb394512601f6af617
2018-11-08 21:48:35 +00:00
Sudheer Shanka
be0febe40a Add sm set-isolated-storage [true|false]
Bug: 119038726
Test: manual
Change-Id: I29eeec7872584f1173e9b6d31434b36487515d9e
2018-11-08 11:36:04 -08:00
Jeff Sharkey
901c04270f Extend adoptable override to force on or off.
Virtual disks are adoptable by default, but for debugging purposes
we want to treat them as unadoptable in some cases.  Add the ability
for the "sm" shell command to force on/off, or return to default.

Bug: 77849654, 74132243
Test: manual
Change-Id: Ieda317396624ca081e5dd9568795483f684f9297
2018-04-20 13:11:23 -06:00
Jeff Sharkey
8eb783b21e FBE devices now fully support adoptable storage.
We've finished all the underlying work to support adoptable storage
on FBE devices, so remove the code that was disabling it by default.

Introduce feature flag to make it easier to detect devices that
support adoptable storage.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Bug: 29923055, 25861755, 33252673, 37289651
Change-Id: I3630d690c9e66c7e41e316a4263ea2eb1e752ad3
2018-01-04 18:50:14 -07:00
Jin Qian
52cd1c5717 Add 'idle-maint' command for use from shell
Test: adb shell sm idle-maint [run|abort]
Bug: 67776637
Change-Id: I5f20adc45aad29dc9267a70bf3eea6a1fa490688
2017-11-14 15:02:53 -08:00
Jeff Sharkey
508cce3f4a Merge "Abort long-running benchmarks, report progress." 2017-11-07 19:23:25 +00:00
Jeff Sharkey
7e19f53f75 Abort long-running benchmarks, report progress.
A typical storage device finishes the benchmark in under 10 seconds,
but some extremely slow devices can take minutes, resulting in a
confusing UX that looks like we've frozen.  Even worse, we keep
churning through all that I/O even though we know the device will
blow past our user-warning threshold.

So periodically check if we've timed out, and also use that to report
progress up into the Settings UI.

Test: manual
Bug: 62201209, 65639764, 67055204
Change-Id: Id28e63a7ea1476d83184abab5aea737a1d193f3a
2017-11-07 09:51:53 -07:00
George Burgess IV
d7f98747b3 Merge "cmds: add #!s" am: 8911c35df3 am: 2c61e3de27
am: 4037fe04d2

Change-Id: If3ccdda50e4542c62a99021576a7717632e5dd40
2017-11-06 23:56:54 +00:00
George Burgess IV
6c1688850e cmds: add #!s
Without this, exec()ing these fails.

Found with `grep -L bin/sh $(grep -Rl Script)`

Bug: None
Test: exec()ed each of these scripts; I no longer get "exec format
error" for any of them.
Change-Id: I47db5007e5cc14ab91eb846b7bffecb925d37874
2017-11-05 01:07:30 -07:00
Jeff Sharkey
b302c54f11 Move long-running calls to async with listeners.
Now that we're using Binder, we can have callers provide explicit
listeners for every request instead of trying to squeeze them all
into unsolicited socket events.

Move benchmarking to be async to avoid blocking other commands for
up to several minutes.  Remove post-trim benchmarking flag, since
benchmarking now requires a separate callback.  Will bring back in
a future CL.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Test: adb shell sm fstrim
Bug: 62201209, 13758960
Change-Id: I26f76c66734ac2fd0f64713b8ab9828430499019
2017-09-15 14:19:46 -06: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
Jeff Sharkey
31d0b7043d Add 'fstrim' command for use from shell.
Test: builds, boots, new command works
Bug: 20948199
Change-Id: If7b122a6c98a4ce2a2f38e545015a22decd1b516
2016-11-21 15:05:09 -07: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
Jeff Sharkey
33dd156ed0 Give users and devices control over sdcardfs.
Instead of relying only on kernel support for sdcardfs, give each
device the ability to quickly toggle between sdcardfs and FUSE.  Also
add the ability to users to explicitly enable/disable the behavior
for testing and debugging purposes.

Bug: 27991427
Change-Id: Ia57f12f6ead888ab85101004bdd8c8003537b116
2016-04-07 11:30:55 -06:00
Jeff Sharkey
b5e89c6deb Support direct-boot tests.
Add shell commands to check on current FBE status and system ready
status.  Mark variables without first-class locking as volatile.

Fix bug where UI automation would crash while device was locked by
marking it as forced direct-boot aware.

Bug: 26498834
Change-Id: Ib4dfb9350925e5413f93a09baacf84c62f2ba0ea
2016-04-02 19:31:19 -06: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
Brian Carlstrom
82bfca4609 Fixes for sm and pm usage
sm showed IllegalArgumentException after usage.
pm inconsistently used "return showUsage()"

Bug: 20948199
Change-Id: I5828489a9d4ef2eabfb97dd408d66e1560a5a983
2015-11-05 10:33:40 -08:00
Jeff Sharkey
85ced63268 More info to support CTS, fix reconcile bug.
Surface more details and commands for storage volumes to support
CTS testing.  Fix user reconciliation bug that skipped user setup on
empty volumes.

Bug: 22658804, 22633097
Change-Id: I4221312d1cce24d1f5a2c108095cf3cf471598ed
2015-07-22 11:11:50 -07:00
Jeff Sharkey
4c099d0c49 Command to change force adoptable state.
Since user builds can't setprop, add an explicit "sm" verb to change
the force adoptable state.

Bug: 21191915
Change-Id: I719d9b18c1a98c97442a5ddb1cc5512e8e4d3d3f
2015-05-15 14:15:35 -07:00
Jeff Sharkey
0d838a0fad Determine if we have adoptable disks.
Bug: 19993667
Change-Id: I9b21b05736c22d34ca22f5ad6e1a6ebec440cfb6
2015-05-13 13:54:35 -07:00
Jeff Sharkey
7d2af54a98 New "sm" shell tool to call StorageManager.
Surface basic StorageManager commands through shell tool, like
simple listing of disks and volumes, and commands like mounting and
partitioning.

The output is designed to be parsed by host-side testing tools,
instead of relying on fragile dumpsys parsing.

Bug: 19993667
Change-Id: I993e92ecf57996678965945f0ae648b392a77ea2
2015-05-12 15:52:43 -07:00