diff options
author | Jeff Brown <jeffbrown@google.com> | 2015-04-07 03:50:29 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-07 03:50:29 +0000 |
commit | 969baf52d9d0366be5d523a38ef89eaa314b2e8b (patch) | |
tree | 7997bfe1bba353d31bd8931bee5d3664c15232b3 /cmds | |
parent | 62b58afc2127ffde5ba41f23d449f8a148f2d633 (diff) | |
parent | d46898fed050b6e2b93ecd3a3da4143b5108024a (diff) | |
download | frameworks_native-969baf52d9d0366be5d523a38ef89eaa314b2e8b.zip frameworks_native-969baf52d9d0366be5d523a38ef89eaa314b2e8b.tar.gz frameworks_native-969baf52d9d0366be5d523a38ef89eaa314b2e8b.tar.bz2 |
Merge "Add support for int64, float, double types to service command."
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/service/service.cpp | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/cmds/service/service.cpp b/cmds/service/service.cpp index 97fc47c..428b87c 100644 --- a/cmds/service/service.cpp +++ b/cmds/service/service.cpp @@ -146,6 +146,15 @@ int main(int argc, char* const argv[]) break; } data.writeInt32(atoi(argv[optind++])); + } else if (strcmp(argv[optind], "i64") == 0) { + optind++; + if (optind >= argc) { + aerr << "service: no integer supplied for 'i64'" << endl; + wantsUsage = true; + result = 10; + break; + } + data.writeInt64(atoll(argv[optind++])); } else if (strcmp(argv[optind], "s16") == 0) { optind++; if (optind >= argc) { @@ -155,6 +164,24 @@ int main(int argc, char* const argv[]) break; } data.writeString16(String16(argv[optind++])); + } else if (strcmp(argv[optind], "f") == 0) { + optind++; + if (optind >= argc) { + aerr << "service: no number supplied for 'f'" << endl; + wantsUsage = true; + result = 10; + break; + } + data.writeFloat(atof(argv[optind++])); + } else if (strcmp(argv[optind], "d") == 0) { + optind++; + if (optind >= argc) { + aerr << "service: no number supplied for 'd'" << endl; + wantsUsage = true; + result = 10; + break; + } + data.writeDouble(atof(argv[optind++])); } else if (strcmp(argv[optind], "null") == 0) { optind++; data.writeStrongBinder(NULL); @@ -272,9 +299,12 @@ int main(int argc, char* const argv[]) aout << "Usage: service [-h|-?]\n" " service list\n" " service check SERVICE\n" - " service call SERVICE CODE [i32 INT | s16 STR] ...\n" + " service call SERVICE CODE [i32 N | i64 N | f N | d N | s16 STR ] ...\n" "Options:\n" - " i32: Write the integer INT into the send parcel.\n" + " i32: Write the 32-bit integer N into the send parcel.\n" + " i64: Write the 64-bit integer N into the send parcel.\n" + " f: Write the 32-bit single-precision number N into the send parcel.\n" + " d: Write the 64-bit double-precision number N into the send parcel.\n" " s16: Write the UTF-16 string STR into the send parcel.\n"; // " intent: Write and Intent int the send parcel. ARGS can be\n" // " action=STR data=STR type=STR launchFlags=INT component=STR categories=STR[,STR,...]\n"; |