Fix getService should retry on DEAD_OBJECT

If getService sees DEAD_OBJECT or nullptr when calling
interfaceChain on the retrieved service, it should
retry. Otherwise (e.g. TRANSACTION_FAILED for selinux
denials), it should bail out.

This retry doesn't happen for tryGetService.

Test: calling Debug.getMemoryInfo from apps does not hang
Test: kill system_server, audio_server restarts exactly once
      (tested 10/10 times)
Test: taking screenshots / using camera / using maps
Test: adb push
$OUT/data/nativetest/VtsHalNfcV1_0TargetTest/VtsHalNfcV1_0TargetTest
/data/local/tmp && adb shell
/data/local/tmp/VtsHalNfcV1_0TargetTest
Test: hidl_test

Bug: 36153684
Bug: 36611652
Change-Id: Ibc0de0953dffea52acb366faf09f397176554502
1 file changed
tree: 3d009bdf0650e9780843971c244ef9c2b9fabde6
  1. c2hal/
  2. test/
  3. utils/
  4. Android.bp
  5. Annotation.cpp
  6. Annotation.h
  7. ArrayType.cpp
  8. ArrayType.h
  9. AST.cpp
  10. AST.h
  11. CompoundType.cpp
  12. CompoundType.h
  13. ConstantExpression.cpp
  14. ConstantExpression.h
  15. Coordinator.cpp
  16. Coordinator.h
  17. DeathRecipientType.cpp
  18. DeathRecipientType.h
  19. EnumType.cpp
  20. EnumType.h
  21. FmqType.cpp
  22. FmqType.h
  23. generateCpp.cpp
  24. generateCppImpl.cpp
  25. generateJava.cpp
  26. generateVts.cpp
  27. HandleType.cpp
  28. HandleType.h
  29. hidl-gen_l.ll
  30. hidl-gen_y.yy
  31. Interface.cpp
  32. Interface.h
  33. Location.h
  34. main.cpp
  35. MemoryType.cpp
  36. MemoryType.h
  37. Method.cpp
  38. Method.h
  39. MODULE_LICENSE_APACHE2
  40. NamedType.cpp
  41. NamedType.h
  42. NOTICE
  43. PointerType.cpp
  44. PointerType.h
  45. README.md
  46. RefType.cpp
  47. RefType.h
  48. ScalarType.cpp
  49. ScalarType.h
  50. Scope.cpp
  51. Scope.h
  52. StringType.cpp
  53. StringType.h
  54. Type.cpp
  55. Type.h
  56. TypeDef.cpp
  57. TypeDef.h
  58. update-makefiles-helper.sh
  59. VectorType.cpp
  60. VectorType.h
README.md

hidl-gen user guide

1. Build

croot
make hidl-gen

2. Run

hidl-gen -o output-path -L language (-r interface-root) fqname

output-path: directory to store the output files.
language: output file for given language. e.g.c++, vts..

fqname: fully qualified name of the input files.
For singe file input, follow the format: package@version::fileName
For directory input, follow the format: package@version

interface-root(optional): prefix and root path for fqname.
If not set, use the default prefix: android.hardware and default root path
defined in $TOP.

examples:

croot
hidl-gen -o output -L c++ -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0::INfc.hal
hidl-gen -o output -L vts -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0
hidl-gen -o test -L c++ -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0