summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2009-11-19 16:26:29 -0800
committerWink Saville <wink@google.com>2009-11-19 16:26:29 -0800
commit0e57e73575f27682b57b8ba615215d1bc2669b3a (patch)
tree14a18dfc05f255e5f760de9a02e05cec842cc289 /telephony
parent57534f1b9f52cea094e8197d1ca40f0d2f68cc66 (diff)
downloadframeworks_base-0e57e73575f27682b57b8ba615215d1bc2669b3a.zip
frameworks_base-0e57e73575f27682b57b8ba615215d1bc2669b3a.tar.gz
frameworks_base-0e57e73575f27682b57b8ba615215d1bc2669b3a.tar.bz2
Increase the default wake lock timeout.
Previously the wake lock time was 5 seconds but there are operations which take longer such as setting up and tearing down so increase the default to 30 seconds. Also provide TelephonyProperty.PROPERTY_WAKE_LOCK_TIMEOUT so it can be overridden at build time. Bug: 2268276 Change-Id: I3ae1fb196564c9fd5b9ea3e3b0927be9dd9ef255
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/com/android/internal/telephony/RIL.java12
-rw-r--r--telephony/java/com/android/internal/telephony/TelephonyProperties.java5
2 files changed, 15 insertions, 2 deletions
diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java
index d802efa..e47f799 100644
--- a/telephony/java/com/android/internal/telephony/RIL.java
+++ b/telephony/java/com/android/internal/telephony/RIL.java
@@ -208,7 +208,12 @@ public final class RIL extends BaseCommands implements CommandsInterface {
private static final boolean DBG = false;
static final boolean RILJ_LOGD = Config.LOGD;
static final boolean RILJ_LOGV = DBG ? Config.LOGD : Config.LOGV;
- static int WAKE_LOCK_TIMEOUT = 5000;
+
+ /**
+ * Wake lock timeout should be longer than the longest timeout in
+ * the vendor ril.
+ */
+ private static final int DEFAULT_WAKE_LOCK_TIMEOUT = 30000;
//***** Instance Variables
@@ -219,6 +224,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
RILReceiver mReceiver;
private Context mContext;
WakeLock mWakeLock;
+ int mWakeLockTimeout;
int mRequestMessagesPending;
// Is this the first radio state change?
@@ -603,6 +609,8 @@ public final class RIL extends BaseCommands implements CommandsInterface {
PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, LOG_TAG);
mWakeLock.setReferenceCounted(false);
+ mWakeLockTimeout = SystemProperties.getInt(TelephonyProperties.PROPERTY_WAKE_LOCK_TIMEOUT,
+ DEFAULT_WAKE_LOCK_TIMEOUT);
mRequestMessagesPending = 0;
mContext = context;
@@ -1996,7 +2004,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
mSender.removeMessages(EVENT_WAKE_LOCK_TIMEOUT);
Message msg = mSender.obtainMessage(EVENT_WAKE_LOCK_TIMEOUT);
- mSender.sendMessageDelayed(msg, WAKE_LOCK_TIMEOUT);
+ mSender.sendMessageDelayed(msg, mWakeLockTimeout);
}
}
diff --git a/telephony/java/com/android/internal/telephony/TelephonyProperties.java b/telephony/java/com/android/internal/telephony/TelephonyProperties.java
index 55ba149..56d84bd 100644
--- a/telephony/java/com/android/internal/telephony/TelephonyProperties.java
+++ b/telephony/java/com/android/internal/telephony/TelephonyProperties.java
@@ -136,4 +136,9 @@ public interface TelephonyProperties
* monotonically, regardless of reboots.
*/
static final String PROPERTY_CDMA_MSG_ID = "persist.radio.cdma.msgid";
+
+ /**
+ * Property to override DEFAULT_WAKE_LOCK_TIMEOUT
+ */
+ static final String PROPERTY_WAKE_LOCK_TIMEOUT = "ro.ril.wake_lock_timeout";
}