Commit Graph

9 Commits

Author SHA1 Message Date
Bob Badour
f7cf305656 [LSC] Add LOCAL_LICENSE_KINDS to development
Added SPDX-license-identifier-Apache-2.0 to:
  apps/BluetoothDebug/Android.bp
  apps/BuildWidget/Android.bp
  apps/CustomLocale/Android.bp
  apps/DevelopmentSettings/Android.bp
  apps/Fallback/Android.bp
  apps/GestureBuilder/Android.bp
  apps/NinePatchLab/Android.bp
  apps/OBJViewer/Android.bp
  apps/PushApiAuthenticator/Android.bp
  apps/PushApiTestAppOne/Android.bp
  apps/PushApiTestAppTwo/Android.bp
  apps/SdkSetup/Android.bp
  apps/SettingInjectorSample/Android.bp
  apps/WidgetPreview/Android.bp
  apps/launchperf/Android.bp
  cmds/monkey/Android.mk
  gsi/gsi_util/Android.bp
  gsi/repack_super_image/Android.bp
  host/windows/Android.bp
  python-packages/Android.bp
  samples/AccelerometerPlay/Android.bp
  samples/AdaptiveIconSample/Android.bp
  samples/AliasActivity/Android.bp
  samples/AndroidBeamDemo/Android.bp
  samples/AppNavigation/Android.bp
  samples/AutofillKeyboard/Android.bp
  samples/BackupRestore/Android.bp
  samples/BasicGLSurfaceView/Android.bp
  samples/BluetoothChat/Android.bp
  samples/BrokenKeyDerivation/Android.bp
  samples/BrokenKeyDerivation/tests/Android.bp
  samples/BusinessCard/Android.bp
  samples/Compass/Android.bp
  samples/ContactManager/Android.bp
  samples/CubeLiveWallpaper/Android.bp
  samples/DataWiper/Android.bp
  samples/DeviceAdminWhitelistedAccount/Android.bp
  samples/FixedGridLayout/Android.bp
  samples/HeavyWeight/Android.bp
  samples/HelloActivity/Android.bp
  samples/HelloActivity/tests/Android.bp
  samples/HelloEffects/Android.bp
  samples/Home/Android.bp
  samples/HoneycombGallery/Android.bp
  samples/InlineFillService/Android.bp
  samples/JetBoy/Android.bp
  samples/LceDemo/Android.bp
  samples/LunarLander/Android.bp
  samples/LunarLander/tests/Android.bp
  samples/MultiResolution/Android.bp
  samples/MultiWindow/Android.bp
  samples/MySampleRss/Android.bp
  samples/NotePad/Android.bp
  samples/Obb/Android.bp
  samples/RSSReader/Android.bp
  samples/ReceiveShareDemo/Android.bp
  samples/SampleSyncAdapter/Android.bp
  samples/SimpleJNI/Android.bp
  samples/SimpleJNI/jni/Android.bp
  samples/SipDemo/Android.bp
  samples/SkeletonApp/Android.bp
  samples/SkeletonApp/tests/Android.bp
  samples/Snake/Android.bp
  samples/Snake/tests/Android.bp
  samples/SoftKeyboard/Android.bp
  samples/SpellChecker/HelloSpellChecker/Android.bp
  samples/SpellChecker/SampleSpellCheckerService/Android.bp
  samples/StackWidget/Android.bp
  samples/ThemedNavBarKeyboard/Android.bp
  samples/ToyVpn/Android.bp
  samples/TtsEngine/Android.bp
  samples/USB/AdbTest/Android.bp
  samples/USB/MissileLauncher/Android.bp
  samples/UiAutomator/Android.mk
  samples/Vault/Android.bp
  samples/Vault/tests/Android.bp
  samples/VoiceRecognitionService/Android.bp
  samples/VoicemailProviderDemo/Android.bp
  samples/WeatherListWidget/Android.bp
  samples/WiFiDirectDemo/Android.bp
  samples/WiFiDirectServiceDiscovery/Android.bp
  samples/Wiktionary/Android.bp
  samples/WiktionarySimple/Android.bp
  samples/XmlAdapters/Android.bp
  samples/apkcachetest/Android.bp
  samples/training/NsdChat/Android.bp
  scripts/Android.bp
  testrunner/Android.mk
  testrunner/tests/Android_native.mk
  tools/apkcheck/Android.bp
  tools/bugreport/Android.bp
  tools/etc1tool/Android.bp
  tools/idegen/Android.bp
  tools/mkstubs/Android.bp
  tools/rmtypedefs/Android.bp
  vndk/Android.bp
  vndk/tools/Android.bp
  vndk/tools/elfcheck/Android.bp
  vndk/tools/header-checker/Android.bp
  vndk/tools/header-checker/src/repr/protobuf/proto/Android.bp
  vndk/tools/header-checker/tests/integration/ifunc/Android.bp
  vndk/tools/header-checker/tests/integration/version_script_example/Android.bp
  vndk/tools/image-diff-tool/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-CPL-1.0 SPDX-license-identifier-MIT
    SPDX-license-identifier-Unicode-DFS SPDX-license-identifier-W3C
    legacy_restricted legacy_unencumbered
to:
  Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-CPL-1.0
to:
  samples/SearchableDictionary/Android.bp

Added SPDX-license-identifier-Apache-2.0 legacy_unencumbered
to:
  tools/Android.bp

Added SPDX-license-identifier-BSD SPDX-license-identifier-CPL-1.0
    SPDX-license-identifier-MIT SPDX-license-identifier-Unicode-DFS
    SPDX-license-identifier-W3C
to:
  sdk/Android.bp

Added legacy_restricted
to:
  samples/KeyChainDemo/Android.bp
  tools/line_endings/Android.bp
  vndk/tools/definition-tool/datasets/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I9847e00fb4278bc083b4debbc751003c995ea45c
2021-02-12 17:13:45 -08:00
SzuWei Lin
a3424fde0b gsi_util: try to use executable in local bin/ folder
cmd_utils.run_command() will try to find the executable file
in the local bin/ folder firstly.

The patch also add some missing dependency files and make sure
gsi_util could run alone.

Bug: 75992357
Test: ./run_test.py
Test: './build.py setup_env',
  then './gsi_util.bin check_compat --system adb --vendor adb' in
  another terminal without lunch

Change-Id: I923eb68b4a6829c8ed5e5d8278e97fd4f5860efc
2018-03-22 15:26:04 +08:00
SzuWei Lin
a07883696e Revise code of gsi_util help
The patch unifies the code of arguments '--vendor' and '--system',
and to be an argument group 'image sources'.

Bug: 64817940
Test: gsi_util.py for each commands and check the output
Change-Id: I591ef4b922f931b7ceaacc362979156ef830a54e
2018-01-29 14:31:17 +08:00
SzuWei Lin
a30d9ef26b gsi_util: adding check_compat subcommand
'check_compat' command can check the compatibility between
system and vendor image, which can be any source supported by
mounters, ex. image file, folder or adb.

Uses following command for the detail:

    $ ./gsu_util.py check_compat --help

The patch also includes a 'checker' framework. There is only
one checker 'VintfChecker' at this time. VintfChecker uses a
host tool, 'checkvintf', to check the compatibility.

Bug: 70253825
Test: check_compat with different mounters
Change-Id: I459b4cbd38465c0058087b4c68bca66e491c940e
2018-01-15 17:35:58 +08:00
SzuWei Lin
18d5e919fe gsi_util: adding dump subcommand
'dump' command can dump information from given image, which could
be a image file, folder or device by adb.

Use $./gsi_util.py dump --help for the detail.

The patch also includes a "dump" framework, to implement some
dumpers to dump information. This patch also includes PropDumper to
dump information from property files, and XmlDumper to dump
information from XML files.

There is an initial dump info list in dump_info_list.py.
Use subcommand 'list_dump' could output the list.

Usually using Dumper is enough to dump information. dump.py is an
example to use Dumper.

Bug: 70253764
Test: dump from different mounter
Change-Id: I7c05f8f24d44d3c7429f2c428963f64191f49a53
2018-01-15 16:01:14 +08:00
SzuWei Lin
e3658bd0c1 gsi_util: adding pull subcommand
'pull' command can pull a file from an image file, folder or adb.

The patch includes a "mounter" framework to implement different
source of the system/vendor image. And also includes several
"mounter" implementations.

CompositeMounter integrates all possible mounter implementations.
Usually just using CompositeMounter is enough. With
CompositeMounter, you could access files in different target
with an unique interface, such files in an image file, a folder or
a device with an unique interface. pull.py is an basic example to
use CompositeMounter.

Here are some example to use 'pull' command:

$ ./gsi_util.py pull --system adb:AB0123456789 /system/manifest.xml
$ ./gsi_util.py pull --vendor adb /vendor/compatibility_matrix.xml
$ ./gsi_util.py pull --system system.img /system/build.prop
$ ./gsi_util.py pull --system my/out/folder/system /system/build.prop

As current implementation, accessing files in a the image file requires
root permission. gsi_util will need user to input the password for sudo.

For the detail usage, reference:

$ ./gsi_util.py pull --help

Bug: 71029338
Test: pull /system/build.prop from different targets
Change-Id: Iaeb6352c14ebc24860ed79fc30edd314e225aef9
2018-01-12 11:48:50 +08:00
Bowgo Tsai
b510ae3a33 gsi_util: adding flash_gsi subcommand
This change implements the flash_gsi subcommand:
  1. Erase userdata/cache partition
  2. Erase metadata partition (optional)
  3. Flash generic system image
  4. Disable Android Verified Boot (optional)
  5. Reboot the device

Bug: 70253882
Test: make gsi_util
Test: gsi_util flash_gsi
Test: gsi_util --debug flash_gsi --image system.img
Change-Id: I552c04aaf227c6fca2e5c3caab26d713e2f6f5d0
2018-01-03 12:44:10 +08:00
Bowgo Tsai
a1f4058845 gsi_util: adding cmd_utils
Adding a run_command function to execute a host command.
Also support reading the stdout and/or stderr of the result if desired,
which might be useful for further parsing and flow decision.

A typical usage will be passing a command sequence:
  cmd_utils.run_command(['echo', '123'])

It also supports running a 'shell' command, by passing a single string:
  cmd_utils.run_command('echo 123', shell=True)

To get the stdout and/or stderr data, just add 'read_stdout=True' and/or
'read_stderr=True':
  cmd_utils.run_command('echo 123', shell=True,
                        read_stdout=True, read_stderr=True),

which returns a namedtuple:
  ('CommandResult', 'returncode stdoutdata, stderrdata').

Note that other keyword arguments will be passed to subprocess.Popen().
e.g., the following command will change current directory to
'my_working_dir' prior to execute the command:
  cmd_utils.run_command('echo 123', shell=True, cwd=my_working_dir)

More usage examples can be found in cmd_utils_unittest.py.

Also adds a run_test.py to search then run ./*tests/*_unittest.py files.

Bug: 70477387
Test: make gsi_util
Test: ./run_test.py
Change-Id: Id3aae935f941818fe7415798937fd07dbbe6ba33
2017-12-29 17:11:27 +08:00
Bowgo Tsai
73fec9375d gsi_util: adding subcommand framework
With this CL, new command can be easily added:
  1. Add a new file: gsi/gsi_util/gsi_util/commands/hello.py
     And implements a function to register parsers into gsi_util's main parser.

     def setup_command_args(subparsers)

  2. In gsi/gsi_util/gsi_util.py, add the new command into GsiUtil():
     _COMMANDS = ['hello']

Bug: 70588453
Test: make gsi_util
Test: gsi_util --help
Test: gsi_util hello --foo
Test: gsi_util --debug hello --bar

Change-Id: I54fa6d1dea5afed724d9ac4a99f88bf78da82732
2017-12-28 17:11:40 +08:00