From: The Android Open Source Project Date: Tue, 10 Feb 2009 23:44:04 +0000 (-0800) Subject: auto import from //branches/cupcake/...@130745 X-Git-Tag: android-x86-2.2~68 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=80bb41e3445d96fb8508609e5bfcae6ea477da18;p=android-x86%2Fhardware-ril.git auto import from //branches/cupcake/...@130745 --- diff --git a/include/telephony/ril.h b/include/telephony/ril.h index fa1948f..57f842f 100644 --- a/include/telephony/ril.h +++ b/include/telephony/ril.h @@ -173,9 +173,10 @@ typedef struct { }RIL_CallForwardInfo; typedef struct { - char * cid; /* cell id in 2G, Primary Scrambling Code in 3G - * hexadecimal format. - * Valid values are 0x00000000 - 0xffffffff. + char * cid; /* Cell Id (as described in TS 27.005) in 16 bits in GSM + * Primary Scrambling Code (as described in TS 25.331) + * in 9 bits in UMTS + * Valid values are hexadecimal 0x0000 - 0xffff. */ int rssi; /* Received RSSI in 2G, * Level index of CPICH Received Signal Code Power in 3G @@ -637,7 +638,9 @@ typedef enum { * * LAC and CID are in hexadecimal format. * valid LAC are 0x0000 - 0xffff - * valid CID are 0x00000000 - 0xffffffff + * valid CID are 0x00000000 - 0x0fffffff + * In GSM, CID is Cell ID (as described in TS 27.007) in 16 bits + * In UMTS, CID is UMTS Cell Identity (as described in TS 25.331) in 28 bits * * Please note that registration state 4 ("unknown") is treated * as "out of service" in the Android telephony system @@ -667,7 +670,7 @@ typedef enum { * * LAC and CID are in hexadecimal format. * valid LAC are 0x0000 - 0xffff - * valid CID are 0x00000000 - 0xffffffff + * valid CID are 0x00000000 - 0x0fffffff * * Please note that registration state 4 ("unknown") is treated * as "out of service" in the Android telephony system diff --git a/libril/Android.mk b/libril/Android.mk index c6266e7..9416f24 100644 --- a/libril/Android.mk +++ b/libril/Android.mk @@ -9,7 +9,8 @@ LOCAL_SRC_FILES:= \ LOCAL_SHARED_LIBRARIES := \ libutils \ - libcutils + libcutils \ + libhardware_legacy LOCAL_CFLAGS := diff --git a/libril/ril.cpp b/libril/ril.cpp index 742296c..e22adc0 100644 --- a/libril/ril.cpp +++ b/libril/ril.cpp @@ -17,6 +17,8 @@ #define LOG_TAG "RILC" +#include + #include #include #include @@ -58,10 +60,6 @@ namespace android { #define ANDROID_WAKE_LOCK_NAME "radio-interface" -#define ANDROID_PARTIAL_WAKE_LOCK_PATH "/sys/android_power/acquire_partial_wake_lock" -#define ANDROID_FULL_WAKE_LOCK_PATH "/sys/android_power/acquire_full_wake_lock" -#define ANDROID_WAKE_UNLOCK_PATH "/sys/android_power/release_wake_lock" - #define PROPERTY_RIL_IMPL "gsm.version.ril-impl" // match with constant in RIL.java @@ -112,7 +110,7 @@ namespace android { #define appendPrintBuf(x...) #endif -enum WakeType {DONT_WAKE, WAKE_PARTIAL, WAKE_FULL}; +enum WakeType {DONT_WAKE, WAKE_PARTIAL}; typedef struct { int requestNumber; @@ -1855,51 +1853,15 @@ done: static void -grabFullWakeLock() -{ - int fd; - - fd = open (ANDROID_FULL_WAKE_LOCK_PATH, O_WRONLY); - - if (fd < 0) { - LOGW ("Cannot open " ANDROID_FULL_WAKE_LOCK_PATH); - return; - } - - write (fd, ANDROID_WAKE_LOCK_NAME, strlen(ANDROID_WAKE_LOCK_NAME)); - close (fd); -} - -static void grabPartialWakeLock() { - int fd; - - fd = open (ANDROID_PARTIAL_WAKE_LOCK_PATH, O_WRONLY); - - if (fd < 0) { - LOGW ("Cannot open " ANDROID_PARTIAL_WAKE_LOCK_PATH); - return; - } - - write (fd, ANDROID_WAKE_LOCK_NAME, strlen(ANDROID_WAKE_LOCK_NAME)); - close (fd); + acquire_wake_lock(PARTIAL_WAKE_LOCK, ANDROID_WAKE_LOCK_NAME); } static void releaseWakeLock() { - int fd; - - fd = open (ANDROID_WAKE_UNLOCK_PATH, O_WRONLY); - - if (fd < 0) { - LOGW ("Cannot open " ANDROID_WAKE_UNLOCK_PATH); - return; - } - - write (fd, ANDROID_WAKE_LOCK_NAME, strlen(ANDROID_WAKE_LOCK_NAME)); - close (fd); + release_wake_lock(ANDROID_WAKE_LOCK_NAME); } /** @@ -1998,11 +1960,6 @@ void RIL_onUnsolicitedResponse(int unsolResponse, void *data, shouldScheduleTimeout = true; break; - case WAKE_FULL: - grabFullWakeLock(); - shouldScheduleTimeout = true; - break; - case DONT_WAKE: default: break;