summaryrefslogtreecommitdiff
path: root/cmds/svc/src
Commit message (Collapse)AuthorAgeFilesLines
* Modified the resetUsbPort command to AsynchronousRicky Niu2022-04-011-1/+10
| | | | | | | | | Because the resetUsbPort API modified to Asynchronous, related function need to be modified. Bug: 217369748 Signed-off-by: Ricky Niu <rickyniu@google.com> Change-Id: Ieef549736532688ff356b4bb8fa790fb10403300
* Add resetUsbPort in svc usb commandRicky Niu2022-04-011-3/+60
| | | | | | | | | | | | | | Implement resetUsbPort to support manual testing on real device to verify feature functionality from App layer and VTS test. Bug: 216387845 Test: Manual test with "svc usb reset UsbPort" correctly Signed-off-by: Ricky Niu <rickyniu@google.com> Change-Id: Ieb29de3dd398859607490548a1f3a16f8359ae8f (cherry picked from commit 519062eabd54d4f961bb3c1ac65e937a678f905b) Merged-In: Ieb29de3dd398859607490548a1f3a16f8359ae8f
* Forward `svc bluetooth` to "cmd bluetooth"William Escande2022-02-232-59/+1
| | | | | | | | | BluetoothShellCommand is now implementing the shell command Fix: 216233593 Test: manual: adb shell svc bluetooth enable Test: manual: adb shell svc bluetooth disable Change-Id: Icbd0395624585d5a22663472b5897ed4518e2670
* Support USB V1.3 HALAlbert Wang2021-02-141-1/+24
| | | | | | | | | | | USB V1.3 HAL include: 1. Add api to enable/disable USB data signaling 2. Add api to inquiry HAL version Bug: 161414036 Test: build pass and functions are working normally Signed-off-by: Albert Wang <albertccwang@google.com> Change-Id: Idb946de553b63f1d9da565133306117a6a4a7dd8
* Add methods for Usb Gadget Hal v1.2raychi2020-11-121-3/+30
| | | | | | | | | 1. Add svc usb getUsbSpeed method 2. Add svc usb getCurrentGadgetHalVersion method Bug: 168282708 Test: build pass and get test result Change-Id: Id3480757fd3545b0cce083aaa3cf906e09ae318c
* Introduce static @hide PowerManager.isRebootingUserspaceSupportedImpl()Nikita Ioffe2020-04-091-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | This method consolidates logic of testing whenever rebooting userspace is supported in a place that can be used both from PowerMager.isRebootingUserspaceSupported() API and from PowerManagerService.reboot() implementation. Consequently, this makes `adb shell svc power reboot userspace` also benefit from that check, and fail userspace reboot on devices that don't support it. Also tweaked logic of ignoring RemoteException to take into account userspace reboot. Test: adb root Test: adb shell setprop init.userspace_reboot.is_supported 0 Test: adb shell svc power reboot userspace & verified error message Test: adb shell setprop init.userspace_reboot.is_supported 1 Test: adb shell svc power reboot userspace & verified no error message Test: atest PowerManagerTest Test: atest CtsUserspaceRebootHostSideTestCases Bug: 152803929 Change-Id: I2d3a8e0ae1320c408a838c5c5fdf4cd977b167b3
* Add svc usb resetUsbGadget methodHoward Yen2020-01-171-1/+10
| | | | | | | | Add svc usb resetUsbGadget method for usb control. Bug: 138702846 Test: adb shell svc usb resetUsbGadget Change-Id: I260a280f20cc924e28201baf2f5ccbd67318772f
* Forward `svc data` to "cmd phone data" in TelephonyShellCommandShuo Qian2019-12-202-69/+0
| | | | | | Bug: 145553588 Test: adb shell commands; manual Change-Id: I687635ff78439dd446df538312c4811ef8073ea3
* Merge "Revert "Deprecate Data Command in Android"" am: 609f65048f am: ↵Automerger Merge Worker2019-12-181-11/+33
|\ | | | | | | | | | | 81ca5f3ee8 am: 77420b1a37 Change-Id: Idf45a7251f6a62912d92ac6ffb89efd789724fea
| * Revert "Deprecate Data Command in Android"Shuo Qian2019-12-181-11/+33
| | | | | | | | | | | | | | | | | | | | This reverts commit 5c4e7b81b571d11851fd9c63a308e1a910b196b9. Reason for revert: <b/146461873> Bug: 146461873 Change-Id: I8bd10333f2014e52e1d3122c5b9dc895a5d6c658
* | Merge "Deprecate Data Command in Android" am: 65943dbc41 am: 3c4fec229a am: ↵Automerger Merge Worker2019-12-171-33/+11
|\| | | | | | | | | | | 81b66fc0b5 Change-Id: I0fd662fb819fd661c068533a6ab86bec4a336ac8
| * Deprecate Data Command in AndroidShuo Qian2019-12-161-33/+11
| | | | | | | | | | | | | | | | Please use adb shell cmd phone data enable/disable instead. Bug: 145553588 Test: adb shell commands; manual Change-Id: I7d1ab779bd6c08dc8c564dc5f3f5d9e165ae39ed
* | Migrate WifiCommand to WifiShellCommandDavid Su2019-11-212-70/+1
|/ | | | | | | | | | | Migrate `svc wifi` to `cmd wifi set-wifi-enabled` since WifiCommand can no longer access @hide IWifiManager.aidl. Bug: 138801922 Test: adb shell svc wifi [enable|disable|asdf|""] Test: adb shell cmd wifi set-wifi-enabled [enabled|disabled|asdf|""] Change-Id: I28d1cb2f33eb9e2890a3208a26a0ccc8fc25840b
* Add ADB command to wait for system server crashMakoto Onuki2019-02-202-0/+68
| | | | | | | | | | | | | "adb shell svc system-server wait-for-crash" will block until the process dies. Bug: 124022170 Test: Manual - Run "adb shell svc system-server wait-for-crash" on multiple terminals - Make sure open FDs aren't increasing by checking /proc/`pid system_server`/fd - adb shell killall system_server - All the "adb shell svc system-server wait-for-crash" should finish. Change-Id: I203d001cd296d506ebf9f5a70b97e05e5769961a
* Add force suspend API to PowerManager.Santos Cordon2019-02-151-1/+27
| | | | | | | | | | Add a hidden system API (protected by DEVICE_POWER) that forces suspend, ignoring any existing wakelock. Add a shell cmd to trigger the API to run. Bug: 111991113 Test: 'adb shell svc power forcesuspend' Change-Id: I5a258e1b7c8b1391fe1baf3930dd9d9af47235c9
* Instrument wake up reasons.Michael Wright2019-02-061-1/+3
| | | | | | | | | This lets us run experiments that need to know the reason for the wake up in addition to the time and latency. Bug: 122949636 Test: manually turning the device on and off, looking at the logs Change-Id: I38429c3387a289010e1a2696ad351ffbe568413b
* Refactor and clean up USB, add testsJerry Zhang2018-01-311-22/+21
| | | | | | | | | | | | | | | | | | Change UsbManager apis to use long instead of string, to match usb hal. Change UsbDeviceManager internals to match as well. Remove isFunctionEnabled and add getEnabledFunctions. Callers would often call isFunctionEnabled for every possible function to get the list of functions, so getEnabledFunctions reduces the number of aidl calls. Separate out dependencies between UsbHandler and UsbDeviceManager and staticize the UsbHandler classes. Add unit tests with mocked out dependencies to test state transitions for UsbHandler. Bug: 62876645 Test: atest UsbTests Change-Id: I785c4c24121a70e725de9742c6af50a6bf1baea0
* Add setScreenUnlockedFunctions method to UsbManagerJerry Zhang2018-01-091-0/+14
| | | | | | | | | | | | | | | | | | | The screen unlocked functions save effort on setting the usb config during each connection. These functions persist between connections and between boots. When the screen is unlocked and these functions are set, the current functions will be automatically set to the screen unlocked functions. Also added svc command for this so it can be used and tested while the UI is worked on. Bug: 62876645 Test: svc usb setScreenUnlockedFunctions mtp Test: Test functions with locking, unlocking, and disconnecting, with no lockscreen, swipe, and pattern Change-Id: Ia05e095917166d25398c4d310b02971e3a1bb12a
* Cherry-pick: Add null check for Wi-Fi commandTakashi Furukawa2017-08-071-0/+4
| | | | | | | | | | | When WifiService is not ready during boot phase and Wi-Fi command is executed on console, NullPointerException happens. To prevent this, null check is needed. Test: Manual test Bug: 64040515 Change-Id: I5684cdc7661b7d93fd6f2ac61863919077d12935 Merged-In: I5684cdc7661b7d93fd6f2ac61863919077d12935
* Merge "Simplify NfcCommand and avoid NullPointerExceptions" am: b5c4e80ecdMyles Watson2017-06-171-35/+18
|\ | | | | | | | | | | am: 7ba9270427 Change-Id: I28b151f93f00cbd3086e8416dbd433f34806205c
| * Merge "Simplify NfcCommand and avoid NullPointerExceptions"Treehugger Robot2017-06-171-35/+18
| |\
| | * Simplify NfcCommand and avoid NullPointerExceptionsMyles Watson2017-06-151-35/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test: adb root adb shell stop svc nfc enable start svc nfc disable Change-Id: Ie5170f0525f8830d1d80b5607191ce95e78a55ae
* | | Merge "Add a svc command for enabling/disabling Bluetooth" am: 7d136b777aMyles Watson2017-06-162-0/+59
|\| | | | | | | | | | | | | | | | | am: c0c6e1243b Change-Id: Iab78d232230a6d9ef02d40a03558f7967af7f48c
| * | Add a svc command for enabling/disabling BluetoothMyles Watson2017-06-162-0/+59
| |/ | | | | | | | | | | | | Bug: 62067926 Test: svc bluetooth disable svc bluetooth enable Change-Id: I9a53d7ab1805df98d8cf1292cf1061eacc14655d
* / ignore RemoteException from pm if shutdown is already on-goingKeun-young Park2017-04-101-2/+13
|/ | | | | | | | | | | | | - In new shutdown flow, adb is guaranteed to be alive while system server is alive. - power manager can be killed before system server is killed. - This leads into RemoteException for shutdown request to power manager. - If shutdown is already on-going (=sys.powerctl set), the RemoteException should be ignored. bug: 37096155 Test: adb shell svc power reboot|shutdown and check output to adb Change-Id: Ia90a900d55123bd7c1bf57c90c49d35332ebfdf5
* Merge changes from topic 'svcusb' am: 5e2a2ee39eJerry Zhang2017-02-171-3/+7
|\ | | | | | | | | | | am: 6f44072d03 Change-Id: Ic30bca41e088c2d077dc5aa09e373a02acb60be6
| * Add data unlock argument to set function command.Jerry Zhang2017-02-161-3/+7
| | | | | | | | | | | | | | | | | | This allows automated switches into file transfer mode, which makes automated Mtp testing possible. Test: adb shell svc setFunction mtp true Bug: 25596495 Change-Id: I67be58853b002789dc22b75d82af9eb6cfb7a361
| * Merge changes from topic 'usb_bugfixes-mirror-aosp-master'Jerry Zhang2016-11-161-1/+1
| |\ | | | | | | | | | | | | | | | | | | * changes: Refactored setCurrentFunction and setUsbDataUnlocked into single method. Clean up persistent usb state on boot. Fixed handling of usb state during adb changes.
| * | Add WiFi toggle prompts - frameworkSvetoslav Ganov2016-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If permission review is enabled toggling WiFi on or off results in a user prompt to collect a consent. This applies only to legacy apps, i.e. ones that don't support runtime permissions as they target SDK 22. Bug: 28715749 Test: Unit Tests Change-Id: I020601e208c0736005bcabc7b7b77b96eee45b03 Merged-In: I020601e208c0736005bcabc7b7b77b96eee45b03
* | | svc nfc should support watches tooTucker Sylvestro2017-01-181-1/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | am: 1876583bfb Change-Id: I9612fbe232ecf883fda2c629438ed55ddb50c468
| * | | svc nfc should support watches tooTucker Sylvestro2017-01-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check for both FEATURE_NFC and FEATURE_NFC_HOST_CARD_EMULATION in the "svc nfc" command. Watches may only have the latter, but should still support the nfc enable/disable command. See b/24532713#comment7 for context. Bug 32386425 Change-Id: I307798f00728c6b437aebfcf58115af7265e3692
| * | | Add WiFi toggle prompts - frameworkSvetoslav Ganov2016-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If permission review is enabled toggling WiFi on or off results in a user prompt to collect a consent. This applies only to legacy apps, i.e. ones that don't support runtime permissions as they target SDK 22. bug:28715749 Change-Id: I020601e208c0736005bcabc7b7b77b96eee45b03
* | | | Refactored setCurrentFunction and setUsbDataUnlocked into single method.Jerry Zhang2016-11-171-1/+1
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | am: 935372bfd6 Change-Id: I5436278e092f691c9179f7cc3709c4578b544e74
| * | | Refactored setCurrentFunction and setUsbDataUnlocked into single method.Jerry Zhang2016-11-151-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gets rid of an extraneous configuration change when going from adb to adb + file transfer as previously the config would have been reset once for functions and once for data unlocked. It also simplifies some of the code. Test: manually changing usb configurations Change-Id: Ica10a195338b2189db13113f44657393db110bee (cherry picked from commit 7a396be6d5ba8914933a54b5bfac25e118db0e9f)
| * | DO NOT MERGE Revert "Add WiFi toggle prompts - framework"Mitchell Wills2016-08-291-1/+1
| | | | | | | | | | | | | | | | | | This reverts commit 40f8b9251831c5f009fd476b1a3d216e126d3ef0. Change-Id: I23e8b6ac97d8853c271429fc13fbfa313717a95a
* | | Add WiFi toggle prompts - frameworkSvetoslav Ganov2016-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If permission review is enabled toggling WiFi on or off results in a user prompt to collect a consent. This applies only to legacy apps, i.e. ones that don't support runtime permissions as they target SDK 22. bug:28715749 Original-Change-Id: I020601e208c0736005bcabc7b7b77b96eee45b03 Change-Id: I3fdc2b02abecaf3166614b0cb9fac3553cb7ab88 (cherry picked from commit d3663c04a721e0848dd3e9179c84ba585d91839d)
* | | DO NOT MERGE Revert "Add WiFi toggle prompts - framework"Mitchell Wills2016-08-291-1/+1
|/ / | | | | | | | | | | This reverts commit 40f8b9251831c5f009fd476b1a3d216e126d3ef0. Change-Id: I9a1d861277e5d32405da5815c8b4e5d616febf10
* / Add WiFi toggle prompts - frameworkSvetoslav Ganov2016-08-291-1/+1
|/ | | | | | | | | | | | If permission review is enabled toggling WiFi on or off results in a user prompt to collect a consent. This applies only to legacy apps, i.e. ones that don't support runtime permissions as they target SDK 22. bug:28715749 Change-Id: I020601e208c0736005bcabc7b7b77b96eee45b03 (cherry picked from commit d3663c04a721e0848dd3e9179c84ba585d91839d)
* Add feature versions for devices and apps.Jeff Sharkey2016-02-151-1/+1
| | | | | | | | | | | | | | | | We're starting to see more instances of device features that will increment separately from the SDK API level, such as camera HAL, GPU capabilities, Bluetooth, and other hardware standards. This change adds the ability for device features to specify a version, which is defined to be backwards compatible. That is, apps requesting an older version of a feature must continue working on devices with a newer version of that same feature. When a version is undefined, we assume the default version "0". Bug: 27162500 Change-Id: If890bf3f3dbb715e8feb80e7059a0d65618482ea
* am 8bc9238f: am 9e4a4606: am fe74fb95: extend svc command to control NFC stateGuang Zhu2015-09-152-1/+87
|\ | | | | | | | | * commit '8bc9238f1438c1c9359b3c8959399c0168dbfc74': extend svc command to control NFC state
| * extend svc command to control NFC stateGuang Zhu2015-09-152-1/+87
| | | | | | | | Change-Id: I599e4000fa17384089410e63b3150f25aa9458f7
* | am b98e2353: am 158560ad: Merge "Distinguish user-requested shutdown from ↵Yusuke Sato2015-08-031-1/+1
|\ \ | |/ |/| | | | | | | | | power-related ones" * commit 'b98e235364c2b221521f622c546733b2862e4677': Distinguish user-requested shutdown from power-related ones
| * Distinguish user-requested shutdown from power-related onesYusuke Sato2015-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this patch, when the user requested shutdown, PowerManagerService sets sys.powerctl is set to "shutdown,userrequested", and init runs fsck on shutdown. When shutdown is triggered due to a low power state etc., the service sets the property to "shutdown,", and init immediately shuts down the system without running the command. This is a follow-up CL for http://r.android.com/158525. Bug: 21853106 Change-Id: Iae72990130fe9aa479c802f77301438190dbbfb3
* | Improve tracking of screen on reasons.Dianne Hackborn2015-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - New screen on app op to record the last time each app has caused the screen to be turned on. - New battery stats event that tells us the reason the screen has been asked to turn on. - Propagate out power manager API to specify the reason a caller is asking to have the screen turned on. Note that currently the window flag to turn the screen on bypasses much of this because it is being handled in the window manager by just directly telling the power manager to turn the screen on. To make this better we need a new API where it can specify who it is calling the API for. Change-Id: I667e56cb1f80508d054da004db667efbcc22e971
* | Modify how USB connections are handled.Nick Kralevich2015-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Introduce a new "charger only" mode. In this mode, MTP is disabled, and no file transfers can occur. * Make charger only mode the default. * Modify "persist.sys.usb.config" so it now only holds the adb status. * Make the USB settings non-persistent. Unplugging the USB connection will reset the device back to "charger only" mode. * Fixup wording per UI guidelines. TODO: Re-implement MDM restrictions for USB / MTP access controls. Bug: 18905620 Change-Id: I99a50d9132a81e98187f431166fd9fef4d437e4f
* | Remove unused imports in frameworks/base.John Spurlock2015-02-282-4/+0
|/ | | | Change-Id: I031443de83f93eb57a98863001826671b18f3b17
* Enabling internal msg apisRobert Greenwalt2014-05-142-26/+4
| | | | | | | | | | | NetworkFactory and NetworkAgent. First trying with wifi and getting rid of WifiStateTracker. Conflicts: api/current.txt services/core/java/com/android/server/ConnectivityService.java Change-Id: I7f0ec13d7d8988b32f3c6dc71f72012f3349fe02
* add reboot and shutdown to `svc power` commandGuang Zhu2013-03-181-3/+27
| | | | | | | a runtime shutdown will be performed first, then device will reboot with the provided reason or power off. Change-Id: I44cfbae19626c46147fad3bc8e91434970daa5d5
* Use correct PowerManager call to wake up screenGuang Zhu2012-09-091-9/+9
| | | | | | The current implementation does not actually wakes up the screen. Change-Id: Ief2dca013cfe40e03b64273fe7b09822e9ad42a7
* add wireless charger supportBrian Muramatsu2012-08-201-4/+6
| | | | | | | | | bug: 6879638 - add new enum value BATTERY_PLUGGED_WIRELESS - check for sys online file with contents "Wireless" Change-Id: I22dc3c40f50573c98643e7b5cbcb237d0216530d