OSDN Git Service

auto import from //branches/cupcake/...@130745
authorThe Android Open Source Project <initial-contribution@android.com>
Tue, 10 Feb 2009 23:44:04 +0000 (15:44 -0800)
committerThe Android Open Source Project <initial-contribution@android.com>
Tue, 10 Feb 2009 23:44:04 +0000 (15:44 -0800)
include/telephony/ril.h
libril/Android.mk
libril/ril.cpp

index fa1948f..57f842f 100644 (file)
@@ -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
index c6266e7..9416f24 100644 (file)
@@ -9,7 +9,8 @@ LOCAL_SRC_FILES:= \
 
 LOCAL_SHARED_LIBRARIES := \
     libutils \
-    libcutils 
+    libcutils \
+    libhardware_legacy
 
 LOCAL_CFLAGS := 
 
index 742296c..e22adc0 100644 (file)
@@ -17,6 +17,8 @@
 
 #define LOG_TAG "RILC"
 
+#include <hardware_legacy/power.h>
+
 #include <telephony/ril.h>
 #include <cutils/sockets.h>
 #include <cutils/jstring.h>
@@ -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;