Loading common/Android.mk +4 −2 Original line number Diff line number Diff line Loading @@ -20,7 +20,9 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := android-common LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := $(call all-java-files-under, java) LOCAL_SRC_FILES := \ $(call all-java-files-under, java) \ $(call all-logtags-files-under, java) include $(BUILD_STATIC_JAVA_LIBRARY) # Include this library in the build server's output directory Loading common/java/com/android/common/GoogleLogTags.logtags 0 → 100644 +100 −0 Original line number Diff line number Diff line # Copyright (C) 2010 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. option java_package com.android.common ##### # This file contains definitions for event log (android.util.EventLog) tags # used by Google Mobile Services applications. These definitions are part of # the platform even when the Google applications are not. # # See system/core/logcat/event.logtags for a description of the file format. # # These event log tags must be assigned specific numbers (no "?") in the range # 200000-300000. If new tags are added, be aware that older platforms will be # missing the tag definitions, and may not be able to show them in their logs. ##### # System Update (OTA) # System update status bits # [31- 9] Reserved for future use # [ 8- 7] package verified (0=not attempted, 1=succeeded, 2=failed) # [ 6] install approved # [ 5] download approved # [ 4- 0] status 201001 system_update (status|1|5),(download_result|1|5),(bytes|2|2),(url|3) 201002 system_update_user (action|3) ##### # Android Market # @param changes Number of changes made to database in reconstruct 202001 vending_reconstruct (changes|1) ##### # Google Services Framework 203001 sync_details (authority|3),(send|1|2),(recv|1|2),(details|3) 203002 google_http_request (elapsed|2|3),(status|1),(appname|3),(reused|1) ##### # Google Talk Service # This event is logged when GTalkService encounters important events 204001 gtalkservice (eventType|1) # This event is logged for GTalk connection state changes. The status field is an int, but # it really contains 4 separate values, each taking up a byte # (eventType << 24) + (connection state << 16) + (connection error << 8) + network state 204002 gtalk_connection (status|1) # This event is logged when GTalk connection is closed. # The status field is an int, but contains 2 different values, it's represented as # # (networkType << 8) + connection error # # the possible error values are # # no_error=0, no_network=1, connection_failed=2, unknown_host=3, auth_failed=4, # auth_expired=5, heart_beat_timeout=6, server_error=7, server_reject_rate_limiting=8, unknown=10 # # duration is the connection duration. 204003 gtalk_conn_close (status|1),(duration|1) # This event is logged for GTalk heartbeat resets # interval_and_nt contains both the heartbeat interval and the network type, It's represented as # (networkType << 16) + interval # interval is in seconds; network type can be 0 (mobile) or 1 (wifi); ip is the host ip addr. 204004 gtalk_heartbeat_reset (interval_and_nt|1),(ip|3) # This event is logged when an Rmq v2 packet is sent or received. 204005 push_messaging (packet_type|1),(persistent_id|3),(stream_id|1),(last_stream_id|1) ##### # Google Login Service and Setup Wizard # This event is for when communicating to the server times out during account setup 205001 setup_server_timeout 205002 setup_required_captcha (action|3) 205003 setup_io_error (status|3) 205004 setup_server_error 205005 setup_retries_exhausted 205006 setup_no_data_network 205007 setup_completed 205008 gls_account_tried (status|1) 205009 gls_account_saved (status|1) 205010 gls_authenticate (status|1),(service|3) 205011 google_mail_switch (direction|1) include/tts/TtsEngine.h +8 −15 Original line number Diff line number Diff line Loading @@ -26,6 +26,12 @@ namespace android { #define ANDROID_TTS_ENGINE_PROPERTY_CONFIG "engineConfig" #define ANDROID_TTS_ENGINE_PROPERTY_PITCH "pitch" #define ANDROID_TTS_ENGINE_PROPERTY_RATE "rate" #define ANDROID_TTS_ENGINE_PROPERTY_VOLUME "volume" enum tts_synth_status { TTS_SYNTH_DONE = 0, TTS_SYNTH_PENDING = 1 Loading Loading @@ -85,7 +91,7 @@ public: // Initialize the TTS engine and returns whether initialization succeeded. // @param synthDoneCBPtr synthesis callback function pointer // @return TTS_SUCCESS, or TTS_FAILURE virtual tts_result init(synthDoneCB_t synthDoneCBPtr); virtual tts_result init(synthDoneCB_t synthDoneCBPtr, const char *engineConfig); // Shut down the TTS engine and releases all associated resources. // @return TTS_SUCCESS, or TTS_FAILURE Loading Loading @@ -220,19 +226,6 @@ public: virtual tts_result synthesizeText(const char *text, int8_t *buffer, size_t bufferSize, void *userdata); // Synthesize IPA text. // As the synthesis is performed, the engine invokes the callback to notify // the TTS framework that it has filled the given buffer, and indicates how // many bytes it wrote. The callback is called repeatedly until the engine // has generated all the audio data corresponding to the IPA data. // @param ipa the IPA data to synthesize // @param userdata pointer to be returned when the call is invoked // @param buffer the location where the synthesized data must be written // @param bufferSize the number of bytes that can be written in buffer // @return TTS_FEATURE_UNSUPPORTED if IPA is not supported, // otherwise TTS_SUCCESS or TTS_FAILURE virtual tts_result synthesizeIpa(const char *ipa, int8_t *buffer, size_t bufferSize, void *userdata); }; } // namespace android Loading include/utils/threads.h +18 −1 Original line number Diff line number Diff line Loading @@ -209,7 +209,7 @@ inline thread_id_t getThreadId() { class Mutex { public: enum { NORMAL = 0, PRIVATE = 0, SHARED = 1 }; Loading Loading @@ -305,7 +305,13 @@ typedef Mutex::Autolock AutoMutex; */ class Condition { public: enum { PRIVATE = 0, SHARED = 1 }; Condition(); Condition(int type); ~Condition(); // Wait on the condition variable. Lock the mutex before calling. status_t wait(Mutex& mutex); Loading @@ -329,6 +335,17 @@ private: inline Condition::Condition() { pthread_cond_init(&mCond, NULL); } inline Condition::Condition(int type) { if (type == SHARED) { pthread_condattr_t attr; pthread_condattr_init(&attr); pthread_condattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); pthread_cond_init(&mCond, &attr); pthread_condattr_destroy(&attr); } else { pthread_cond_init(&mCond, NULL); } } inline Condition::~Condition() { pthread_cond_destroy(&mCond); } Loading libs/binder/IPCThreadState.cpp +21 −18 Original line number Diff line number Diff line Loading @@ -935,16 +935,26 @@ status_t IPCThreadState::executeCommand(int32_t cmd) mCallingPid = tr.sender_pid; mCallingUid = tr.sender_euid; bool doBackground = !gDisableBackgroundScheduling && getpriority(PRIO_PROCESS, mMyThreadId) >= ANDROID_PRIORITY_BACKGROUND; if (doBackground) { // We have inherited a background priority from the caller. int curPrio = getpriority(PRIO_PROCESS, mMyThreadId); if (gDisableBackgroundScheduling) { if (curPrio > ANDROID_PRIORITY_NORMAL) { // We have inherited a reduced priority from the caller, but do not // want to run in that state in this process. The driver set our // priority already (though not our scheduling class), so bounce // it back to the default before invoking the transaction. setpriority(PRIO_PROCESS, mMyThreadId, ANDROID_PRIORITY_NORMAL); } } else { if (curPrio >= ANDROID_PRIORITY_BACKGROUND) { // We want to use the inherited priority from the caller. // Ensure this thread is in the background scheduling class, // since the driver won't modify scheduling classes for us. // The scheduling group is reset to default by the caller // once this method returns after the transaction is complete. androidSetThreadSchedulingGroup(mMyThreadId, ANDROID_TGROUP_BG_NONINTERACT); } } //LOGI(">>>> TRANSACT from pid %d uid %d\n", mCallingPid, mCallingUid); Loading Loading @@ -983,13 +993,6 @@ status_t IPCThreadState::executeCommand(int32_t cmd) mCallingPid = origPid; mCallingUid = origUid; if (doBackground) { // We moved to the background scheduling group to execute // this transaction, so now that we are done go back in the // foreground. androidSetThreadSchedulingGroup(mMyThreadId, ANDROID_TGROUP_DEFAULT); } IF_LOG_TRANSACTIONS() { TextOutput::Bundle _b(alog); alog << "BC_REPLY thr " << (void*)pthread_self() << " / obj " Loading Loading
common/Android.mk +4 −2 Original line number Diff line number Diff line Loading @@ -20,7 +20,9 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := android-common LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := $(call all-java-files-under, java) LOCAL_SRC_FILES := \ $(call all-java-files-under, java) \ $(call all-logtags-files-under, java) include $(BUILD_STATIC_JAVA_LIBRARY) # Include this library in the build server's output directory Loading
common/java/com/android/common/GoogleLogTags.logtags 0 → 100644 +100 −0 Original line number Diff line number Diff line # Copyright (C) 2010 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. option java_package com.android.common ##### # This file contains definitions for event log (android.util.EventLog) tags # used by Google Mobile Services applications. These definitions are part of # the platform even when the Google applications are not. # # See system/core/logcat/event.logtags for a description of the file format. # # These event log tags must be assigned specific numbers (no "?") in the range # 200000-300000. If new tags are added, be aware that older platforms will be # missing the tag definitions, and may not be able to show them in their logs. ##### # System Update (OTA) # System update status bits # [31- 9] Reserved for future use # [ 8- 7] package verified (0=not attempted, 1=succeeded, 2=failed) # [ 6] install approved # [ 5] download approved # [ 4- 0] status 201001 system_update (status|1|5),(download_result|1|5),(bytes|2|2),(url|3) 201002 system_update_user (action|3) ##### # Android Market # @param changes Number of changes made to database in reconstruct 202001 vending_reconstruct (changes|1) ##### # Google Services Framework 203001 sync_details (authority|3),(send|1|2),(recv|1|2),(details|3) 203002 google_http_request (elapsed|2|3),(status|1),(appname|3),(reused|1) ##### # Google Talk Service # This event is logged when GTalkService encounters important events 204001 gtalkservice (eventType|1) # This event is logged for GTalk connection state changes. The status field is an int, but # it really contains 4 separate values, each taking up a byte # (eventType << 24) + (connection state << 16) + (connection error << 8) + network state 204002 gtalk_connection (status|1) # This event is logged when GTalk connection is closed. # The status field is an int, but contains 2 different values, it's represented as # # (networkType << 8) + connection error # # the possible error values are # # no_error=0, no_network=1, connection_failed=2, unknown_host=3, auth_failed=4, # auth_expired=5, heart_beat_timeout=6, server_error=7, server_reject_rate_limiting=8, unknown=10 # # duration is the connection duration. 204003 gtalk_conn_close (status|1),(duration|1) # This event is logged for GTalk heartbeat resets # interval_and_nt contains both the heartbeat interval and the network type, It's represented as # (networkType << 16) + interval # interval is in seconds; network type can be 0 (mobile) or 1 (wifi); ip is the host ip addr. 204004 gtalk_heartbeat_reset (interval_and_nt|1),(ip|3) # This event is logged when an Rmq v2 packet is sent or received. 204005 push_messaging (packet_type|1),(persistent_id|3),(stream_id|1),(last_stream_id|1) ##### # Google Login Service and Setup Wizard # This event is for when communicating to the server times out during account setup 205001 setup_server_timeout 205002 setup_required_captcha (action|3) 205003 setup_io_error (status|3) 205004 setup_server_error 205005 setup_retries_exhausted 205006 setup_no_data_network 205007 setup_completed 205008 gls_account_tried (status|1) 205009 gls_account_saved (status|1) 205010 gls_authenticate (status|1),(service|3) 205011 google_mail_switch (direction|1)
include/tts/TtsEngine.h +8 −15 Original line number Diff line number Diff line Loading @@ -26,6 +26,12 @@ namespace android { #define ANDROID_TTS_ENGINE_PROPERTY_CONFIG "engineConfig" #define ANDROID_TTS_ENGINE_PROPERTY_PITCH "pitch" #define ANDROID_TTS_ENGINE_PROPERTY_RATE "rate" #define ANDROID_TTS_ENGINE_PROPERTY_VOLUME "volume" enum tts_synth_status { TTS_SYNTH_DONE = 0, TTS_SYNTH_PENDING = 1 Loading Loading @@ -85,7 +91,7 @@ public: // Initialize the TTS engine and returns whether initialization succeeded. // @param synthDoneCBPtr synthesis callback function pointer // @return TTS_SUCCESS, or TTS_FAILURE virtual tts_result init(synthDoneCB_t synthDoneCBPtr); virtual tts_result init(synthDoneCB_t synthDoneCBPtr, const char *engineConfig); // Shut down the TTS engine and releases all associated resources. // @return TTS_SUCCESS, or TTS_FAILURE Loading Loading @@ -220,19 +226,6 @@ public: virtual tts_result synthesizeText(const char *text, int8_t *buffer, size_t bufferSize, void *userdata); // Synthesize IPA text. // As the synthesis is performed, the engine invokes the callback to notify // the TTS framework that it has filled the given buffer, and indicates how // many bytes it wrote. The callback is called repeatedly until the engine // has generated all the audio data corresponding to the IPA data. // @param ipa the IPA data to synthesize // @param userdata pointer to be returned when the call is invoked // @param buffer the location where the synthesized data must be written // @param bufferSize the number of bytes that can be written in buffer // @return TTS_FEATURE_UNSUPPORTED if IPA is not supported, // otherwise TTS_SUCCESS or TTS_FAILURE virtual tts_result synthesizeIpa(const char *ipa, int8_t *buffer, size_t bufferSize, void *userdata); }; } // namespace android Loading
include/utils/threads.h +18 −1 Original line number Diff line number Diff line Loading @@ -209,7 +209,7 @@ inline thread_id_t getThreadId() { class Mutex { public: enum { NORMAL = 0, PRIVATE = 0, SHARED = 1 }; Loading Loading @@ -305,7 +305,13 @@ typedef Mutex::Autolock AutoMutex; */ class Condition { public: enum { PRIVATE = 0, SHARED = 1 }; Condition(); Condition(int type); ~Condition(); // Wait on the condition variable. Lock the mutex before calling. status_t wait(Mutex& mutex); Loading @@ -329,6 +335,17 @@ private: inline Condition::Condition() { pthread_cond_init(&mCond, NULL); } inline Condition::Condition(int type) { if (type == SHARED) { pthread_condattr_t attr; pthread_condattr_init(&attr); pthread_condattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); pthread_cond_init(&mCond, &attr); pthread_condattr_destroy(&attr); } else { pthread_cond_init(&mCond, NULL); } } inline Condition::~Condition() { pthread_cond_destroy(&mCond); } Loading
libs/binder/IPCThreadState.cpp +21 −18 Original line number Diff line number Diff line Loading @@ -935,16 +935,26 @@ status_t IPCThreadState::executeCommand(int32_t cmd) mCallingPid = tr.sender_pid; mCallingUid = tr.sender_euid; bool doBackground = !gDisableBackgroundScheduling && getpriority(PRIO_PROCESS, mMyThreadId) >= ANDROID_PRIORITY_BACKGROUND; if (doBackground) { // We have inherited a background priority from the caller. int curPrio = getpriority(PRIO_PROCESS, mMyThreadId); if (gDisableBackgroundScheduling) { if (curPrio > ANDROID_PRIORITY_NORMAL) { // We have inherited a reduced priority from the caller, but do not // want to run in that state in this process. The driver set our // priority already (though not our scheduling class), so bounce // it back to the default before invoking the transaction. setpriority(PRIO_PROCESS, mMyThreadId, ANDROID_PRIORITY_NORMAL); } } else { if (curPrio >= ANDROID_PRIORITY_BACKGROUND) { // We want to use the inherited priority from the caller. // Ensure this thread is in the background scheduling class, // since the driver won't modify scheduling classes for us. // The scheduling group is reset to default by the caller // once this method returns after the transaction is complete. androidSetThreadSchedulingGroup(mMyThreadId, ANDROID_TGROUP_BG_NONINTERACT); } } //LOGI(">>>> TRANSACT from pid %d uid %d\n", mCallingPid, mCallingUid); Loading Loading @@ -983,13 +993,6 @@ status_t IPCThreadState::executeCommand(int32_t cmd) mCallingPid = origPid; mCallingUid = origUid; if (doBackground) { // We moved to the background scheduling group to execute // this transaction, so now that we are done go back in the // foreground. androidSetThreadSchedulingGroup(mMyThreadId, ANDROID_TGROUP_DEFAULT); } IF_LOG_TRANSACTIONS() { TextOutput::Bundle _b(alog); alog << "BC_REPLY thr " << (void*)pthread_self() << " / obj " Loading