Commit Graph

77 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
Ryan Prichard
a51b4796c7 Add "--" to separate program args from lldb/gdb server args
Without this, "lldbclient.py -r ls --help" fails, because the lldb/gdb
server handles the "--help" argument rather than passing it through to
the program being started.

Test: lldbclient.py --lldb -r /system/bin/ls --help
Test: gdbclient.py --no-lldb -r /system/bin/ls --help
Change-Id: I76c7e73b535125ea96f5435bbfe99099786956c1
2020-09-21 20:48:52 -07:00
Haibo Huang
e8ab4475ea Merge "Make lldb default for gdbclient.py" 2020-09-15 22:04:29 +00:00
Haibo Huang
6a4636a9ef Make lldb default for gdbclient.py
Adds a symlink lldbclient.py that pointing to gdbclient.py

Bug: 168187078
Change-Id: I1831875812d22bb6a264b8396bc9d3b8ed7712e3
2020-09-15 18:55:52 +00:00
Haibo Huang
0cb1c9b4e5 Show a warning if adb is not root before gdbclient.py
Bug: 168278173
Change-Id: I0e60c4036b611e31ffd3436ae2389780e9cda0e3
2020-09-15 11:28:46 -07:00
Josh Gao
e955f07799 Support lists of files in adb.AndroidDevice.push.
Bug: http://b/166155032
Test: system/core/adb/test_device.py
Change-Id: I7a6514070b5bbb379f2652053de64a7603e988ae
2020-09-08 18:09:32 -07:00
Treehugger Robot
dfb244428a Merge "Update gitignore." 2020-05-19 03:36:44 +00:00
Haibo Huang
07e17073c5 Updates gdbclient.py for lldb
1. Sets up source mapping so that people can run from other directories.
2. Removes PYTHONHOME. It is embedded into the binary.

Change-Id: Ic7a7f1483dc645d890b7e0f3dcbb0ebb169794ac
2020-05-12 16:51:29 -07:00
Dan Albert
f92680d51a Update gitignore.
Was missing .mypy_cache mainly, but this is a full update from
https://github.com/github/gitignore/blob/master/Python.gitignore.

Test: git status
Bug: None
Change-Id: Ic47242e907cd24a8e58d2ba1d5c3fc2c6d4b7513
2020-05-08 11:41:32 -07:00
Haibo Huang
a1d5d38249 [NDK] Add an option to gdbrunner to run lldb
Test: Run ndk-gdb on ndkgdbsample app
Change-Id: I29a892565693adec06d48570e92386e775c87e28
2019-12-10 00:45:43 +00:00
Adrian Salido
8d10687419 adb_py: Build python3 module
Commit 1b06c6e40d ("Python 3 compatibility.") addressed python3
compatilbity issues for adb python package. Enable it in build.

Test: python3 test.py
Change-Id: Ie00e86f473a79f215b8e053a6ed8be5a2184e0a4
2019-09-24 23:06:54 +00:00
Ryan Prichard
5d1c3cb157 gdbclient: support various PT_INTERP values
gdb looks for an executable's dynamic linker using the PT_INTERP setting
from the executable. That value can be various things:
 - /system/bin/linker[64]
 - /system/bin/linker_asan[64]
 - /system/bin/bootstrap/linker[64]

Currently, only the bootstrap linker is available in the sysroot/symbols
directory. The ordinary and ASAN linkers are symlinks on the target and
are missing from the sysroot (aka symbols) directory.

Use the executable's PT_INTERP value to find the symbolized linker binary
and add it to the solib search path. If necessary, copy or pull a linker
binary.

Test: gdbclient.py -r ls
  "info sharedlib" shows $OUT/symbols/apex/com.android.runtime.debug/bin/linker64

Test: gdbclient.py -r /data/nativetest64/bionic-unit-tests/bionic-unit-tests
  "info sharedlib" shows $OUT/symbols/system/bin/bootstrap/linker64

Test: m asan_test
  gdbclient.py -r /data/nativetest64/asan_test/asan_test
  "info sharedlib" shows /tmp/gdbclient-linker-HunVs9/linker_asan64

Bug: http://b/134183407
Change-Id: I7f79943dcd9ec762d1aaf21178bb6ab3eff40617
2019-06-11 16:07:37 -07:00
Dan Albert
be37f5542d Add Python git ignore.
Test: git status (after having built this package)
Bug: None
Change-Id: I63c36eef51b7ecb950af0ad06385e13a3b0cd870
2018-04-26 12:48:30 -07:00
Dan Albert
1b06c6e40d Python 3 compatibility.
Test: ndk/run_tests.py
Bug: None
Change-Id: Id0d2d8024adec880c1a41b524704df1641cda065
2018-02-14 12:46:58 -08:00
Elliott Hughes
22b6b9faf9 Add python-packages OWNERS.
Bug: N/A
Test: N/A
Change-Id: Ia7ef3254454a851577873e92d38ede3b84b3bbbf
2017-12-14 12:50:14 -08:00
Treehugger Robot
1fc6d09b95 Merge "The "ps" command has changed in Android O" 2017-11-13 23:34:22 +00:00
Josh Gao
908c4dbd10 Move GetDeviceTest from adb's test_device.py to adb package.
This test actually belongs with the adb python wrapper, since it's not
affected by changes to adb itself.

Bug: http://b/64260633
Test: python test.py
Change-Id: Ia70a5529e30d91ea6232c65c9d50b2dabd07b925
2017-11-08 14:39:34 -08:00
André Keller
cc915e152f The "ps" command has changed in Android O
The gdbrunner script executes "ps" to list all running processes and
this needs to be changed to "ps -A" (toybox) for Android O instead of
"ps -w" (busybox) for custom ROMs or "ps" (toolbox) as default.

Test: manual
Change-Id: I99606cdf51b124369e4d0fcfe5917109cefe408c
2017-11-08 16:26:12 +01:00
Ryan Prichard
5b1219eaaa Record the path to adb used for the device
Test: run ndk-gdb.py
Change-Id: I12487c63ee00aae46adba9c98056f295a341c64a
2017-10-19 17:40:28 -07:00
Ryan Prichard
01fa9e488b gdbrunner: strip the newline off the result of "which executable"
Test: gdbclient.py -r echo foo
Change-Id: Id95d9f4e78c5e9dbd8ca8e30ffcfaff9bf5ef7c7
2017-10-11 17:45:20 -07:00
Kevin Rocard
258c89e9e4 Resolve gdbclient.py -r executable from target
gdbclient.py -r allows to provide an executable to be run on the target.
Before this patch the absolute path of the executable had to be
provided. This was inconvenient as the user has to first look up for the
exe on the target before debuging it.

With this patch, gdbclient.py will look for the executable on the
target if an absolute path is not provided.

Test: gdbserver -r ls
Change-Id: I610fd0a57b034ba8864874eeb1f7345d4a7daad9
Signed-off-by: Kevin Rocard <krocard@google.com>
2017-07-12 18:48:16 -07:00
Elliott Hughes
89e1ecf9a1 Fix gdbclient.py -p.
Bug: http://b/26413900
Test: manually ran gdbserver on device, connected with -p
Change-Id: If58b95e52167c38263e77fe85bea14e0d7401bf4
2017-06-30 14:03:32 -07:00
Treehugger Robot
e79b9969d6 Merge "Remove device.get_props." 2017-06-15 19:45:27 +00:00
Roland Levillain
d403f09a40 gdbrunner: Fix find_binary's named argument.
Rename it from `user` to `run_as_cmd` to match the use of this method
in handle_switches in scripts/gdbclient.py.

Test: Run scripts/gdbclient.py -p <PID> on suspended process having pid <PID>
Change-Id: I9820858b1f43d5cb25a9a59e9df618ed4e47f3f0
2017-06-05 13:07:27 +01:00
Elliott Hughes
c34da2dcc7 Remove device.get_props.
Bug: https://issuetracker.google.com/37093233
Test: N/A
Change-Id: I6f516904475354e51071544bf1bf6ccb0f30f583
2017-06-02 17:22:37 -07:00
Treehugger Robot
3099f0c89d Merge "gdbrunner: take a run-as/su command instead of a user." 2017-05-31 00:35:47 +00:00
Josh Gao
057c2739fc gdbrunner: take a run-as/su command instead of a user.
Switch from assuming that "root" meant su to an explicit prepended
argument, to allow things like `gdbclient.py --user shell`.

Test: gdbclient.py --user shell -r /system/bin/ls
Change-Id: I9d02eea7c6d79898ed8b13817e009630b0f9536a
2017-05-24 18:32:25 -07:00
GuangHui Liu
328def813e Add Soong rule for python adb library.
Test: m adb_integration_test_adb adb_integration_test_device

Change-Id: Id055f10adfb14f18f30b92131682d758de72c3c7
2017-05-22 12:37:20 -07:00
Dan Albert
c52723d77d Add support for push --sync.
Test: nose2 in system/core/adb
Bug: None
Change-Id: I6dcea2ff38a721f941c4abeba2949a319ea8c75f
2017-05-19 11:11:43 -07:00
Daniel Rosenberg
83bef81a9c Add python fastboot package
Change-Id: I310b259c59e2a1c609254ea60e8fc6438d3b2dc5
2016-08-16 17:12:38 -07:00
Josh Gao
095a4a276a gdbrunner: avoid using [ on older devices.
Bug: https://github.com/android-ndk/ndk/issues/78
Change-Id: I00cae89076d3b76ab3e29e884015ea3a2eabecb8
2016-05-04 16:04:18 -07:00
Josh Gao
016c18c73d Fix adb.py.
oops

Change-Id: Id3e11ebc89d32f1d0a606047f9b69469fe701098
2016-03-29 11:33:30 -07:00
Josh Gao
f3532aedfa gdbrunner: decapitalize usage for --adb.
Change-Id: I36e84e2570d41c0723a35eab9cea329af4987006
2016-03-28 18:38:55 -07:00
Josh Gao
1d404e6c92 adb.py: require adb version >= 35 to use shell protocol.
Change-Id: I2513db8a88e1a1bd96ce642251882de97ca37df6
2016-03-28 14:10:57 -07:00
Josh Gao
7f6e8ddb79 gdbrunner: expose adb.split_lines, use it.
Change-Id: I895aacaababf87c1e82ff5604c028cc475207304
2016-03-28 11:26:03 -07:00
Josh Gao
dc10068c64 gdbrunner: don't use getppid to name the log file.
Windows doesn't really have a concept of process parenthood.

Bug: https://github.com/android-ndk/ndk/issues/46
Change-Id: I1a47eb42a9eb5d94c95136bb73eac1caabb923c7
2016-03-28 11:26:03 -07:00
Josh Gao
a0f62495a4 gdbrunner: close the exec script before passing it to gdb.
Windows won't allow gdb to open to file while we have it open.

Bug: https://github.com/android-ndk/ndk/issues/46
Change-Id: I5dcee7c70a582e94c472d6d09bf79c2616ea76fa
2016-03-28 11:26:02 -07:00
Dan Albert
9bee8c209c Replace splitlines() with something more tolerant.
Old devices suck. Old devices on Windows seem to suck harder.

Change-Id: I88df25d2c480439859c913e9d8f8fb7ef04b7d5b
2016-02-24 12:28:45 -08:00
Dan Albert
aaf5455b16 Add a fix for old, broken devices.
Not sure exactly why this happens, but it keeps cropping up on my JB
nakasi when running the NDK tests.

Change-Id: Ic5c35f9ab01c0a83f98a6d074220c89ec765a812
2016-02-24 11:39:42 -08:00
Dan Albert
5ca14aa777 Fix the pylint issues that have built up...
Change-Id: I73b14c468a27dffb5c3524b2141682f9e1cafe35
2016-02-24 11:39:14 -08:00
Dan Albert
7000f03bce Add NOTICE files for our projects.
Bug: http://b/25592257
Change-Id: I4bdd59c30ce1ecca68c7aa133b4a32afb72927cf
2016-01-08 13:43:53 -08:00
Josh Gao
5cd0f10ebc Move adb tests to system/core/adb.
Change-Id: Ieeb0e1122a7b13a784ec8c19cf360c7699dcd9ff
2015-12-09 11:25:57 -08:00
Spencer Low
82aa7da5a6 win32: for Unicode cmdline args, switch from cmd.exe to powershell.exe
Previously, to pass a subprocess cmdline args with Unicode characters,
we'd write the command line to a batch file and run it with cmd.exe. The
problem was that the batch file used chcp to get cmd.exe to be able to
read UTF-8 from the batch file, but this had the side-effect of changing
the codepage of the user's console window.

Instead of saving & restoring the codepage (which would always have the
risk of somehow leaving the console in the wrong codepage if a Ctrl-C
handler somehow wasn't called, or if Task Manager was used manually,
etc.), we use Windows PowerShell as the helper instead of cmd.exe.

PowerShell is installed on every version of Windows since Windows 7 and
is a separate free download for Windows XP and Windows Vista, but
realistically Windows XP is no longer supported by Microsoft and
probably no one chooses to run Windows Vista over Windows 7. Plus, this
change only uses PowerShell if Unicode args are passed.

Switching to PowerShell allows us to get rid of the temp file, context
manager, and messy __del__ that caused a variety of problems in the
past.

Change-Id: Ia3df533f7747f7b9b28a093f8ca24117371e5e59
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-11-21 20:39:56 -08:00
Josh Gao
95e0260252 Merge "adb: update tests for push/pull directory change." 2015-11-11 23:22:47 +00:00
Spencer Low
08d0622fa5 adb unittest: make test_unicode_paths stricter
After pushing to a Unicode path, use 'adb shell ls' to verify that the
path was created with the right name. This verifies that the UTF-16 to
UTF-8 conversion is done properly.

When pulling to a Unicode path, verify that the local file has been
created with the expected name. This should test UTF-16 to UTF-8
(command line to internal data structures) and UTF-8 to UTF-16 (internal
data structures to CreateFileW()).

Change-Id: I8b80aae731cf0d058cb0c3259e7f58256e86b771
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-11-10 23:30:35 -08:00
Josh Gao
7fe79d6515 adb: update tests for push/pull directory change.
Bug: http://b/25394682
Change-Id: Iaae5ceedc7a38e9981503a81136966939c6d7280
2015-11-07 17:56:19 -08:00
Josh Gao
084d084bbc Merge "adb: add tests for pushing/pulling empty dirs." 2015-11-07 00:53:02 +00:00
Josh Gao
cdf675849c adb: add tests for pushing/pulling empty dirs.
Change-Id: I840a31fc8f37939a1166ac39700363a8b79cc3be
2015-11-06 15:01:48 -08:00
David Pursell
51f2cc2185 adb: fix device module for non-shell_v2 usage.
The device.py module was incorrectly querying the return code when the
shell_v2 return code isn't available.

This CL fixes it by specifying the return code probe as an argument
list rather than a single string argument. This means that before the
device was executing something like this:

  /system/bin/sh getprop '; echo $?'

which didn't do what we wanted. Now it does something like this:

  /system/bin/sh getprop ; echo $?

Bug: http://b/25470461
Change-Id: I5e20da31ec7ecc782c6146d8b38d752d52082860
2015-11-05 11:26:42 -08:00
Spencer Low
5e50d6b443 unittest for sending data thru adb forward/reverse; --no-rebind unittest
Added --no-rebind unittest to test fix
a6b340af123b82e3aaa33cb2a0d45f637eeb4759

Change-Id: I2286b7f652c84fbc79d8860c9a04594d3284ee68
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-11-04 22:12:26 -08:00