upload android base code part6
This commit is contained in:
parent
421e214c7d
commit
4e516ec6ed
35396 changed files with 9188716 additions and 0 deletions
35
android/system/tools/aidl/docs/constants.md
Normal file
35
android/system/tools/aidl/docs/constants.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Defining constants as part of an interface
|
||||
|
||||
AIDL has been enhanced to support defining integer and string constants
|
||||
as part of an interface.
|
||||
|
||||
## Integer constants
|
||||
|
||||
```
|
||||
interface IMyInterface {
|
||||
const int CONST_A = 1;
|
||||
const int CONST_B = 2;
|
||||
const int CONST_C = 3;
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
These map to appropriate 32 bit integer class constants in Java and C++ (e.g.
|
||||
`IMyInterface.CONST_A` and `IMyInterface::CONST_A` respectively).
|
||||
|
||||
## String constants
|
||||
|
||||
```
|
||||
interface IMyInterface {
|
||||
const String CONST_A = "foo";
|
||||
const String CONST_B = "bar";
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
These map to class level String constants in Java, and static getter
|
||||
functions that return a const android::String16& in C++.
|
||||
|
||||
The constants are limited to contain printable ASCII characters < 0x10
|
||||
and without backspaces (i.e. no '\' character).
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue