rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | diff --git a/system/core/include/cutils/atomic.h b/system/core/include/cutils/atomic.h |
| 2 | index ded972a..fb83e77 100644 |
| 3 | --- a/system/core/include/cutils/atomic.h |
| 4 | +++ b/system/core/include/cutils/atomic.h |
| 5 | @@ -19,7 +19,12 @@ |
| 6 | |
| 7 | #include <stdint.h> |
| 8 | #include <sys/types.h> |
| 9 | +#ifdef __cplusplus |
| 10 | +#include <atomic> |
| 11 | +using namespace std; |
| 12 | +#else |
| 13 | #include <stdatomic.h> |
| 14 | +#endif |
| 15 | |
| 16 | #ifndef ANDROID_ATOMIC_INLINE |
| 17 | #define ANDROID_ATOMIC_INLINE static inline |
| 18 | diff --git a/system/core/include/cutils/properties.h b/system/core/include/cutils/properties.h |
| 19 | index 24aa224..2957e2c 100644 |
| 20 | --- a/system/core/include/cutils/properties.h |
| 21 | +++ b/system/core/include/cutils/properties.h |
| 22 | @@ -33,8 +33,8 @@ extern "C" { |
| 23 | ** WARNING: system/bionic/include/sys/system_properties.h also defines |
| 24 | ** these, but with different names. (TODO: fix that) |
| 25 | */ |
| 26 | -#define PROPERTY_KEY_MAX PROP_NAME_MAX |
| 27 | -#define PROPERTY_VALUE_MAX PROP_VALUE_MAX |
| 28 | +#define PROPERTY_KEY_MAX 64 |
| 29 | +#define PROPERTY_VALUE_MAX 96 |
| 30 | |
| 31 | /* property_get: returns the length of the value which will never be |
| 32 | ** greater than PROPERTY_VALUE_MAX - 1 and will always be zero terminated. |
| 33 | diff --git a/system/core/include/private/android_filesystem_config.h b/system/core/include/private/android_filesystem_config.h |
| 34 | index e540de2..dac5eb5 100644 |
| 35 | --- a/system/core/include/private/android_filesystem_config.h |
| 36 | +++ b/system/core/include/private/android_filesystem_config.h |
| 37 | @@ -40,7 +40,7 @@ |
| 38 | |
| 39 | #define AID_ROOT 0 /* traditional unix root user */ |
| 40 | |
| 41 | -#define AID_SYSTEM 1000 /* system server */ |
| 42 | +#define AID_SYSTEM 0 /* system server */ |
| 43 | |
| 44 | #define AID_RADIO 1001 /* telephony subsystem, RIL */ |
| 45 | #define AID_BLUETOOTH 1002 /* bluetooth subsystem */ |
| 46 | diff --git a/system/core/include/sysutils/FrameworkListener.h b/system/core/include/sysutils/FrameworkListener.h |
| 47 | index 18049cd..2137069 100644 |
| 48 | --- a/system/core/include/sysutils/FrameworkListener.h |
| 49 | +++ b/system/core/include/sysutils/FrameworkListener.h |
| 50 | @@ -32,6 +32,7 @@ private: |
| 51 | int mCommandCount; |
| 52 | bool mWithSeq; |
| 53 | FrameworkCommandCollection *mCommands; |
| 54 | + bool mSkipToNextNullByte; |
| 55 | |
| 56 | public: |
| 57 | FrameworkListener(const char *socketName); |
| 58 | diff --git a/system/core/include/sysutils/NetlinkEvent.h b/system/core/include/sysutils/NetlinkEvent.h |
| 59 | index b80f3ea..fd9cab4 100644 |
| 60 | --- a/system/core/include/sysutils/NetlinkEvent.h |
| 61 | +++ b/system/core/include/sysutils/NetlinkEvent.h |
| 62 | @@ -34,6 +34,9 @@ public: |
| 63 | kRdnss = 8, |
| 64 | kRouteUpdated = 9, |
| 65 | kRouteRemoved = 10, |
| 66 | + kIPv6Enable = 100, |
| 67 | + kIPv6Disable = 101, |
| 68 | + kNoRA = 108, |
| 69 | }; |
| 70 | |
| 71 | private: |
| 72 | @@ -64,6 +67,8 @@ public: |
| 73 | bool parseNfPacketMessage(struct nlmsghdr *nh); |
| 74 | bool parseRtMessage(const struct nlmsghdr *nh); |
| 75 | bool parseNdUserOptMessage(const struct nlmsghdr *nh); |
| 76 | + bool parseNewPrefixMessage(const struct nlmsghdr *nh); |
| 77 | + bool parseNoRAMessage(const struct nlmsghdr *nh); |
| 78 | }; |
| 79 | |
| 80 | #endif |
| 81 | diff --git a/system/core/include/utils/CallStack.h b/system/core/include/utils/CallStack.h |
| 82 | index 27e89f4..ee986b7 100644 |
| 83 | --- a/system/core/include/utils/CallStack.h |
| 84 | +++ b/system/core/include/utils/CallStack.h |
| 85 | @@ -18,7 +18,12 @@ |
| 86 | #define ANDROID_CALLSTACK_H |
| 87 | |
| 88 | #include <android/log.h> |
| 89 | +#ifdef __ANDROID__ |
| 90 | #include <backtrace/backtrace_constants.h> |
| 91 | +#else |
| 92 | +#define BACKTRACE_CURRENT_THREAD -1 |
| 93 | +#endif |
| 94 | + |
| 95 | #include <utils/String8.h> |
| 96 | #include <utils/Vector.h> |
| 97 | |
| 98 | diff --git a/system/core/include/utils/Printer.h b/system/core/include/utils/Printer.h |
| 99 | index bb66287..5371afb 100644 |
| 100 | --- a/system/core/include/utils/Printer.h |
| 101 | +++ b/system/core/include/utils/Printer.h |
| 102 | @@ -17,7 +17,11 @@ |
| 103 | #ifndef ANDROID_PRINTER_H |
| 104 | #define ANDROID_PRINTER_H |
| 105 | |
| 106 | +#if defined(__ANDROID__) |
| 107 | #include <android/log.h> |
| 108 | +#else |
| 109 | +#include <cutils/log.h> |
| 110 | +#endif |
| 111 | |
| 112 | namespace android { |
| 113 | |
| 114 | diff --git a/system/core/include/utils/ThreadDefs.h b/system/core/include/utils/ThreadDefs.h |
| 115 | index ae091e4..7f73c4e 100644 |
| 116 | --- a/system/core/include/utils/ThreadDefs.h |
| 117 | +++ b/system/core/include/utils/ThreadDefs.h |
| 118 | @@ -19,8 +19,66 @@ |
| 119 | |
| 120 | #include <stdint.h> |
| 121 | #include <sys/types.h> |
| 122 | +#if defined(__ANDROID__) |
| 123 | #include <system/graphics.h> |
| 124 | #include <system/thread_defs.h> |
| 125 | +#else |
| 126 | + |
| 127 | +#if defined(__cplusplus) |
| 128 | +extern "C" { |
| 129 | +#endif |
| 130 | + |
| 131 | +enum { |
| 132 | + /* |
| 133 | + * *********************************************** |
| 134 | + * ** Keep in sync with android.os.Process.java ** |
| 135 | + * *********************************************** |
| 136 | + * |
| 137 | + * This maps directly to the "nice" priorities we use in Android. |
| 138 | + * A thread priority should be chosen inverse-proportionally to |
| 139 | + * the amount of work the thread is expected to do. The more work |
| 140 | + * a thread will do, the less favorable priority it should get so that |
| 141 | + * it doesn't starve the system. Threads not behaving properly might |
| 142 | + * be "punished" by the kernel. |
| 143 | + * Use the levels below when appropriate. Intermediate values are |
| 144 | + * acceptable, preferably use the {MORE|LESS}_FAVORABLE constants below. |
| 145 | + */ |
| 146 | + ANDROID_PRIORITY_LOWEST = 19, |
| 147 | + |
| 148 | + /* use for background tasks */ |
| 149 | + ANDROID_PRIORITY_BACKGROUND = 10, |
| 150 | + |
| 151 | + /* most threads run at normal priority */ |
| 152 | + ANDROID_PRIORITY_NORMAL = 0, |
| 153 | + |
| 154 | + /* threads currently running a UI that the user is interacting with */ |
| 155 | + ANDROID_PRIORITY_FOREGROUND = -2, |
| 156 | + |
| 157 | + /* the main UI thread has a slightly more favorable priority */ |
| 158 | + ANDROID_PRIORITY_DISPLAY = -4, |
| 159 | + |
| 160 | + /* ui service treads might want to run at a urgent display (uncommon) */ |
| 161 | + ANDROID_PRIORITY_URGENT_DISPLAY = -8, |
| 162 | + |
| 163 | + /* all normal audio threads */ |
| 164 | + ANDROID_PRIORITY_AUDIO = -16, |
| 165 | + |
| 166 | + /* service audio threads (uncommon) */ |
| 167 | + ANDROID_PRIORITY_URGENT_AUDIO = -18, |
| 168 | + |
| 169 | + /* should never be used in practice. regular process might not |
| 170 | + * be allowed to use this level */ |
| 171 | + ANDROID_PRIORITY_HIGHEST = -20, |
| 172 | + |
| 173 | + ANDROID_PRIORITY_DEFAULT = ANDROID_PRIORITY_NORMAL, |
| 174 | + ANDROID_PRIORITY_MORE_FAVORABLE = -1, |
| 175 | + ANDROID_PRIORITY_LESS_FAVORABLE = +1, |
| 176 | +}; |
| 177 | + |
| 178 | +#if defined(__cplusplus) |
| 179 | +} |
| 180 | +#endif |
| 181 | +#endif |
| 182 | |
| 183 | // --------------------------------------------------------------------------- |
| 184 | // C API |
| 185 | diff --git a/system/core/include/utils/Vector.h b/system/core/include/utils/Vector.h |
| 186 | index ed7b725..239b33f 100644 |
| 187 | --- a/system/core/include/utils/Vector.h |
| 188 | +++ b/system/core/include/utils/Vector.h |
| 189 | @@ -242,13 +242,13 @@ Vector<TYPE>::~Vector() { |
| 190 | |
| 191 | template<class TYPE> inline |
| 192 | Vector<TYPE>& Vector<TYPE>::operator = (const Vector<TYPE>& rhs) { |
| 193 | - VectorImpl::operator = (rhs); |
| 194 | + VectorImpl::operator = (static_cast<const VectorImpl&>(rhs)); |
| 195 | return *this; |
| 196 | } |
| 197 | |
| 198 | template<class TYPE> inline |
| 199 | const Vector<TYPE>& Vector<TYPE>::operator = (const Vector<TYPE>& rhs) const { |
| 200 | - VectorImpl::operator = (static_cast<const VectorImpl&>(rhs)); |
| 201 | + VectorImpl::operator = (rhs); |
| 202 | return *this; |
| 203 | } |
| 204 | |
| 205 | diff --git a/system/core/base/include/android-base/strings.h b/system/core/base/include/android-base/strings.h |
| 206 | index 69781cd..82f7897 100644 |
| 207 | --- a/system/core/base/include/android-base/strings.h |
| 208 | +++ b/system/core/base/include/android-base/strings.h |
| 209 | @@ -62,6 +62,9 @@ bool StartsWith(const std::string& s, const char* prefix); |
| 210 | // Tests whether 's' ends with 'suffix'. |
| 211 | bool EndsWith(const std::string& s, const char* suffix); |
| 212 | |
| 213 | +// Tests whether 'lhs' equals 'rhs', ignoring case. |
| 214 | +bool EqualsIgnoreCase(const std::string& lhs, const std::string& rhs); |
| 215 | + |
| 216 | } // namespace base |
| 217 | } // namespace android |
| 218 | |