-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsystem_core.patch
117 lines (109 loc) · 3.66 KB
/
system_core.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
diff --git a/include/utils/Flattenable.h b/include/utils/Flattenable.h
index 882a8b2..495b90d 100644
--- a/include/utils/Flattenable.h
+++ b/include/utils/Flattenable.h
@@ -79,21 +79,35 @@ class FlattenableUtils {
* Flattenable objects must implement this protocol.
*/
+#ifndef STE_HARDWARE
template <typename T>
+#endif
class Flattenable {
public:
// size in bytes of the flattened object
+#ifdef STE_HARDWARE
+ virtual size_t getFlattenedSize() const = 0;
+#else
inline size_t getFlattenedSize() const;
+#endif
// number of file descriptors to flatten
+#ifdef STE_HARDWARE
+ virtual size_t getFdCount() const = 0;
+#else
inline size_t getFdCount() const;
+#endif
// flattens the object into buffer.
// size should be at least of getFlattenedSize()
// file descriptors are written in the fds[] array but ownership is
// not transfered (ie: they must be dupped by the caller of
// flatten() if needed).
+#ifdef STE_HARDWARE
+ virtual status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const = 0;
+#else
inline status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const;
+#endif
// unflattens the object from buffer.
// size should be equal to the value of getFlattenedSize() when the
@@ -102,6 +116,13 @@ class Flattenable {
// don't need to be dupped(). ie: the caller of unflatten doesn't
// keep ownership. If a fd is not retained by unflatten() it must be
// explicitly closed.
+#ifdef STE_HARDWARE
+ virtual status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count) = 0;
+
+protected:
+ virtual ~Flattenable() = 0;
+};
+#else
inline status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count);
};
@@ -123,6 +144,7 @@ class Flattenable {
void const*& buffer, size_t& size, int const*& fds, size_t& count) {
return static_cast<T*>(this)->T::unflatten(buffer, size, fds, count);
}
+#endif
/*
* LightFlattenable is a protocol allowing object to serialize themselves out
diff --git a/libutils/Android.mk b/libutils/Android.mk
index 720443e..d48991d 100644
--- a/libutils/Android.mk
+++ b/libutils/Android.mk
@@ -22,6 +22,7 @@ commonSources:= \
BlobCache.cpp \
CallStack.cpp \
FileMap.cpp \
+ Flattenable.cpp \
JenkinsHash.cpp \
LinearAllocator.cpp \
LinearTransform.cpp \
diff --git a/libutils/Flattenable.cpp b/libutils/Flattenable.cpp
new file mode 100644
index 0000000..39135e3
--- /dev/null
+++ b/libutils/Flattenable.cpp
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2006 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <utils/Flattenable.h>
+
+namespace android {
+
+Flattenable::~Flattenable() {
+}
+
+}; // namespace android
diff --git a/libcutils/android_reboot.c b/libcutils/android_reboot.c
index 326d402..ab836ec 100644
--- a/libcutils/android_reboot.c
+++ b/libcutils/android_reboot.c
@@ -93,7 +93,7 @@ static void remount_ro(void)
/* Now poll /proc/mounts till it's done */
- while (!remount_ro_done() && (cnt < 3600)) {
+ while (!remount_ro_done() && (cnt < 50)) {
usleep(100000);
cnt++;
}