summaryrefslogtreecommitdiffstats
path: root/media/mediaserver
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2015-06-10 15:12:38 +0100
committerNeil Fuller <nfuller@google.com>2015-06-11 12:59:18 +0100
commit4b60b068c27a40731bd4a0049cb632da18bf521d (patch)
tree9565fcd81affa99e9215abb4b0deda71bf683a35 /media/mediaserver
parent2f3406517d1fd4486b8b90eb2635d784fad17a48 (diff)
downloadframeworks_av-4b60b068c27a40731bd4a0049cb632da18bf521d.zip
frameworks_av-4b60b068c27a40731bd4a0049cb632da18bf521d.tar.gz
frameworks_av-4b60b068c27a40731bd4a0049cb632da18bf521d.tar.bz2
Switch to using shared over local code for initializing ICU
A static library now exists in external/icu/android_utils. Bug: 21730722 Change-Id: I8302b585d3c87fd1a975301ceca4ceebaccbcac9
Diffstat (limited to 'media/mediaserver')
-rw-r--r--media/mediaserver/Android.mk4
-rw-r--r--media/mediaserver/IcuUtils.h25
-rw-r--r--media/mediaserver/icuutils.cpp42
-rw-r--r--media/mediaserver/main_mediaserver.cpp2
4 files changed, 3 insertions, 70 deletions
diff --git a/media/mediaserver/Android.mk b/media/mediaserver/Android.mk
index 78dfbb1..b6de0d9 100644
--- a/media/mediaserver/Android.mk
+++ b/media/mediaserver/Android.mk
@@ -11,8 +11,7 @@ endif
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
- main_mediaserver.cpp \
- icuutils.cpp
+ main_mediaserver.cpp
LOCAL_SHARED_LIBRARIES := \
libaudioflinger \
@@ -33,6 +32,7 @@ LOCAL_SHARED_LIBRARIES := \
libradioservice
LOCAL_STATIC_LIBRARIES := \
+ libicuandroid_utils \
libregistermsext
LOCAL_C_INCLUDES := \
diff --git a/media/mediaserver/IcuUtils.h b/media/mediaserver/IcuUtils.h
deleted file mode 100644
index 52fab6d..0000000
--- a/media/mediaserver/IcuUtils.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#ifndef ICU_UTILS_H
-#define ICU_UTILS_H
-
-// Initializes ICU or dies trying. This must be called when the process
-// is single threaded.
-void initializeIcuOrDie();
-
-#endif // ICU_UTILS_H
-
diff --git a/media/mediaserver/icuutils.cpp b/media/mediaserver/icuutils.cpp
deleted file mode 100644
index 4015849..0000000
--- a/media/mediaserver/icuutils.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2015 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 "IcuUtils.h"
-
-#include "unicode/putil.h"
-#include "unicode/uclean.h"
-#include "unicode/utypes.h"
-#include "utils/Log.h"
-
-#include <stdlib.h>
-
-void initializeIcuOrDie() {
- const char* systemPathPrefix = getenv("ANDROID_ROOT");
- LOG_ALWAYS_FATAL_IF(systemPathPrefix == NULL, "ANDROID_ROOT environment variable not set");
-
- char buf[256];
- const int num_written = snprintf(buf, sizeof(buf), "%s/usr/icu/", systemPathPrefix);
- LOG_ALWAYS_FATAL_IF((num_written < 0 || static_cast<size_t>(num_written) >= sizeof(buf)),
- "Unable to construct ICU path.");
-
- u_setDataDirectory(buf);
- UErrorCode status = U_ZERO_ERROR;
-
- // u_setDataDirectory doesn't try doing anything with the directory we gave
- // it, so we'll have to call u_init to make sure it was successful.
- u_init(&status);
- LOG_ALWAYS_FATAL_IF(!U_SUCCESS(status), "Failed to initialize ICU %s", u_errorName(status));
-}
diff --git a/media/mediaserver/main_mediaserver.cpp b/media/mediaserver/main_mediaserver.cpp
index 27a40b2..4a485ed 100644
--- a/media/mediaserver/main_mediaserver.cpp
+++ b/media/mediaserver/main_mediaserver.cpp
@@ -125,7 +125,7 @@ int main(int argc __unused, char** argv)
prctl(PR_SET_PDEATHSIG, SIGKILL); // if parent media.log dies before me, kill me also
setpgid(0, 0); // but if I die first, don't kill my parent
}
- initializeIcuOrDie();
+ InitializeIcuOrDie();
sp<ProcessState> proc(ProcessState::self());
sp<IServiceManager> sm = defaultServiceManager();
ALOGI("ServiceManager: %p", sm.get());