[Feature]add MT2731_MP2_MR2_SVN388 baseline version

Change-Id: Ief04314834b31e27effab435d3ca8ba33b499059
diff --git a/meta/meta-mediatek/recipes-support/platform-libs-common/files/include.patch b/meta/meta-mediatek/recipes-support/platform-libs-common/files/include.patch
new file mode 100644
index 0000000..b13bff7
--- /dev/null
+++ b/meta/meta-mediatek/recipes-support/platform-libs-common/files/include.patch
@@ -0,0 +1,218 @@
+diff --git a/system/core/include/cutils/atomic.h b/system/core/include/cutils/atomic.h
+index ded972a..fb83e77 100644
+--- a/system/core/include/cutils/atomic.h
++++ b/system/core/include/cutils/atomic.h
+@@ -19,7 +19,12 @@
+ 
+ #include <stdint.h>
+ #include <sys/types.h>
++#ifdef __cplusplus
++#include <atomic>
++using namespace std;
++#else
+ #include <stdatomic.h>
++#endif
+ 
+ #ifndef ANDROID_ATOMIC_INLINE
+ #define ANDROID_ATOMIC_INLINE static inline
+diff --git a/system/core/include/cutils/properties.h b/system/core/include/cutils/properties.h
+index 24aa224..2957e2c 100644
+--- a/system/core/include/cutils/properties.h
++++ b/system/core/include/cutils/properties.h
+@@ -33,8 +33,8 @@ extern "C" {
+ ** WARNING: system/bionic/include/sys/system_properties.h also defines
+ **          these, but with different names.  (TODO: fix that)
+ */
+-#define PROPERTY_KEY_MAX   PROP_NAME_MAX
+-#define PROPERTY_VALUE_MAX  PROP_VALUE_MAX
++#define PROPERTY_KEY_MAX   64
++#define PROPERTY_VALUE_MAX  96
+ 
+ /* property_get: returns the length of the value which will never be
+ ** greater than PROPERTY_VALUE_MAX - 1 and will always be zero terminated.
+diff --git a/system/core/include/private/android_filesystem_config.h b/system/core/include/private/android_filesystem_config.h
+index e540de2..dac5eb5 100644
+--- a/system/core/include/private/android_filesystem_config.h
++++ b/system/core/include/private/android_filesystem_config.h
+@@ -40,7 +40,7 @@
+ 
+ #define AID_ROOT             0  /* traditional unix root user */
+ 
+-#define AID_SYSTEM        1000  /* system server */
++#define AID_SYSTEM        0  /* system server */
+ 
+ #define AID_RADIO         1001  /* telephony subsystem, RIL */
+ #define AID_BLUETOOTH     1002  /* bluetooth subsystem */
+diff --git a/system/core/include/sysutils/FrameworkListener.h b/system/core/include/sysutils/FrameworkListener.h
+index 18049cd..2137069 100644
+--- a/system/core/include/sysutils/FrameworkListener.h
++++ b/system/core/include/sysutils/FrameworkListener.h
+@@ -32,6 +32,7 @@ private:
+     int mCommandCount;
+     bool mWithSeq;
+     FrameworkCommandCollection *mCommands;
++    bool mSkipToNextNullByte;
+ 
+ public:
+     FrameworkListener(const char *socketName);
+diff --git a/system/core/include/sysutils/NetlinkEvent.h b/system/core/include/sysutils/NetlinkEvent.h
+index b80f3ea..fd9cab4 100644
+--- a/system/core/include/sysutils/NetlinkEvent.h
++++ b/system/core/include/sysutils/NetlinkEvent.h
+@@ -34,6 +34,9 @@ public:
+         kRdnss = 8,
+         kRouteUpdated = 9,
+         kRouteRemoved = 10,
++        kIPv6Enable = 100,
++        kIPv6Disable = 101,
++        kNoRA = 108,
+     };
+ 
+ private:
+@@ -64,6 +67,8 @@ public:
+     bool parseNfPacketMessage(struct nlmsghdr *nh);
+     bool parseRtMessage(const struct nlmsghdr *nh);
+     bool parseNdUserOptMessage(const struct nlmsghdr *nh);
++    bool parseNewPrefixMessage(const struct nlmsghdr *nh);    
++    bool parseNoRAMessage(const struct nlmsghdr *nh);   
+ };
+ 
+ #endif
+diff --git a/system/core/include/utils/CallStack.h b/system/core/include/utils/CallStack.h
+index 27e89f4..ee986b7 100644
+--- a/system/core/include/utils/CallStack.h
++++ b/system/core/include/utils/CallStack.h
+@@ -18,7 +18,12 @@
+ #define ANDROID_CALLSTACK_H
+ 
+ #include <android/log.h>
++#ifdef __ANDROID__
+ #include <backtrace/backtrace_constants.h>
++#else
++#define BACKTRACE_CURRENT_THREAD -1
++#endif
++
+ #include <utils/String8.h>
+ #include <utils/Vector.h>
+ 
+diff --git a/system/core/include/utils/Printer.h b/system/core/include/utils/Printer.h
+index bb66287..5371afb 100644
+--- a/system/core/include/utils/Printer.h
++++ b/system/core/include/utils/Printer.h
+@@ -17,7 +17,11 @@
+ #ifndef ANDROID_PRINTER_H
+ #define ANDROID_PRINTER_H
+ 
++#if defined(__ANDROID__)
+ #include <android/log.h>
++#else
++#include <cutils/log.h>
++#endif
+ 
+ namespace android {
+ 
+diff --git a/system/core/include/utils/ThreadDefs.h b/system/core/include/utils/ThreadDefs.h
+index ae091e4..7f73c4e 100644
+--- a/system/core/include/utils/ThreadDefs.h
++++ b/system/core/include/utils/ThreadDefs.h
+@@ -19,8 +19,66 @@
+ 
+ #include <stdint.h>
+ #include <sys/types.h>
++#if defined(__ANDROID__)
+ #include <system/graphics.h>
+ #include <system/thread_defs.h>
++#else
++
++#if defined(__cplusplus)
++extern "C" {
++#endif
++
++enum {
++    /*
++     * ***********************************************
++     * ** Keep in sync with android.os.Process.java **
++     * ***********************************************
++     *
++     * This maps directly to the "nice" priorities we use in Android.
++     * A thread priority should be chosen inverse-proportionally to
++     * the amount of work the thread is expected to do. The more work
++     * a thread will do, the less favorable priority it should get so that
++     * it doesn't starve the system. Threads not behaving properly might
++     * be "punished" by the kernel.
++     * Use the levels below when appropriate. Intermediate values are
++     * acceptable, preferably use the {MORE|LESS}_FAVORABLE constants below.
++     */
++    ANDROID_PRIORITY_LOWEST         =  19,
++
++    /* use for background tasks */
++    ANDROID_PRIORITY_BACKGROUND     =  10,
++
++    /* most threads run at normal priority */
++    ANDROID_PRIORITY_NORMAL         =   0,
++
++    /* threads currently running a UI that the user is interacting with */
++    ANDROID_PRIORITY_FOREGROUND     =  -2,
++
++    /* the main UI thread has a slightly more favorable priority */
++    ANDROID_PRIORITY_DISPLAY        =  -4,
++
++    /* ui service treads might want to run at a urgent display (uncommon) */
++    ANDROID_PRIORITY_URGENT_DISPLAY =  -8,
++
++    /* all normal audio threads */
++    ANDROID_PRIORITY_AUDIO          = -16,
++
++    /* service audio threads (uncommon) */
++    ANDROID_PRIORITY_URGENT_AUDIO   = -18,
++
++    /* should never be used in practice. regular process might not
++     * be allowed to use this level */
++    ANDROID_PRIORITY_HIGHEST        = -20,
++
++    ANDROID_PRIORITY_DEFAULT        = ANDROID_PRIORITY_NORMAL,
++    ANDROID_PRIORITY_MORE_FAVORABLE = -1,
++    ANDROID_PRIORITY_LESS_FAVORABLE = +1,
++};
++
++#if defined(__cplusplus)
++}
++#endif
++#endif
+ 
+ // ---------------------------------------------------------------------------
+ // C API
+diff --git a/system/core/include/utils/Vector.h b/system/core/include/utils/Vector.h
+index ed7b725..239b33f 100644
+--- a/system/core/include/utils/Vector.h
++++ b/system/core/include/utils/Vector.h
+@@ -242,13 +242,13 @@ Vector<TYPE>::~Vector() {
+ 
+ template<class TYPE> inline
+ Vector<TYPE>& Vector<TYPE>::operator = (const Vector<TYPE>& rhs) {
+-    VectorImpl::operator = (rhs);
++    VectorImpl::operator = (static_cast<const VectorImpl&>(rhs));
+     return *this; 
+ }
+ 
+ template<class TYPE> inline
+ const Vector<TYPE>& Vector<TYPE>::operator = (const Vector<TYPE>& rhs) const {
+-    VectorImpl::operator = (static_cast<const VectorImpl&>(rhs));
++    VectorImpl::operator = (rhs);
+     return *this;
+ }
+
+diff --git a/system/core/base/include/android-base/strings.h b/system/core/base/include/android-base/strings.h
+index 69781cd..82f7897 100644
+--- a/system/core/base/include/android-base/strings.h
++++ b/system/core/base/include/android-base/strings.h
+@@ -62,6 +62,9 @@ bool StartsWith(const std::string& s, const char* prefix);
+ // Tests whether 's' ends with 'suffix'.
+ bool EndsWith(const std::string& s, const char* suffix);
+ 
++// Tests whether 'lhs' equals 'rhs', ignoring case.
++bool EqualsIgnoreCase(const std::string& lhs, const std::string& rhs);
++
+ }  // namespace base
+ }  // namespace android
+ 
\ No newline at end of file