androidfw.patch 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. Submodule src/base contains modified content
  2. diff --git a/src/base/libs/androidfw/ResourceTypes.cpp b/src/base/libs/androidfw/ResourceTypes.cpp
  3. index cae2d0bc16b3..13c5f8fc84e8 100644
  4. --- a/src/base/libs/androidfw/ResourceTypes.cpp
  5. +++ b/src/base/libs/androidfw/ResourceTypes.cpp
  6. @@ -43,7 +43,7 @@
  7. #include <utils/String16.h>
  8. #include <utils/String8.h>
  9. -#ifdef __ANDROID__
  10. +#if 0
  11. #include <binder/TextOutput.h>
  12. #endif
  13. diff --git a/src/base/libs/androidfw/include/androidfw/ResourceTypes.h b/libs/androidfw/include/androidfw/ResourceTypes.h
  14. index 3d66244646d5..2d27c34a9154 100644
  15. --- a/src/base/libs/androidfw/include/androidfw/ResourceTypes.h
  16. +++ b/src/base/libs/androidfw/include/androidfw/ResourceTypes.h
  17. @@ -500,7 +500,7 @@ struct ResStringPool_span
  18. // The range of characters in the string that this span applies to.
  19. uint32_t firstChar, lastChar;
  20. -};
  21. +} __attribute__((__packed__, aligned(1)));
  22. /**
  23. * Convenience class for accessing data in a ResStringPool resource.
  24. diff --git a/src/base/libs/androidfw/include/androidfw/StringPiece.h b/src/base/libs/androidfw/include/androidfw/StringPiece.h
  25. index 921877dc4982..27e27e1c2b94 100644
  26. --- a/src/base/libs/androidfw/include/androidfw/StringPiece.h
  27. +++ b/src/base/libs/androidfw/include/androidfw/StringPiece.h
  28. @@ -75,6 +75,11 @@ class BasicStringPiece {
  29. bool operator>(const BasicStringPiece<TChar>& rhs) const;
  30. bool operator==(const BasicStringPiece<TChar>& rhs) const;
  31. bool operator!=(const BasicStringPiece<TChar>& rhs) const;
  32. + // for std::basic_string
  33. + bool operator<(const std::basic_string<TChar>& rhs) const;
  34. + bool operator>(const std::basic_string<TChar>& rhs) const;
  35. + bool operator==(const std::basic_string<TChar>& rhs) const;
  36. + bool operator!=(const std::basic_string<TChar>& rhs) const;
  37. const_iterator begin() const;
  38. const_iterator end() const;
  39. @@ -256,6 +261,26 @@ inline bool BasicStringPiece<TChar>::operator!=(const BasicStringPiece<TChar>& r
  40. return compare(rhs) != 0;
  41. }
  42. +template <typename TChar>
  43. +inline bool BasicStringPiece<TChar>::operator<(const std::basic_string<TChar>& rhs) const {
  44. + return compare(BasicStringPiece(rhs)) < 0;
  45. +}
  46. +
  47. +template <typename TChar>
  48. +inline bool BasicStringPiece<TChar>::operator>(const std::basic_string<TChar>& rhs) const {
  49. + return compare(BasicStringPiece(rhs)) > 0;
  50. +}
  51. +
  52. +template <typename TChar>
  53. +inline bool BasicStringPiece<TChar>::operator==(const std::basic_string<TChar>& rhs) const {
  54. + return compare(BasicStringPiece(rhs)) == 0;
  55. +}
  56. +
  57. +template <typename TChar>
  58. +inline bool BasicStringPiece<TChar>::operator!=(const std::basic_string<TChar>& rhs) const{
  59. + return compare(BasicStringPiece(rhs)) != 0;
  60. +}
  61. +
  62. template <typename TChar>
  63. inline typename BasicStringPiece<TChar>::const_iterator BasicStringPiece<TChar>::begin() const {
  64. return data_;