aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Bejram <christian.bejram@stericsson.com>2010-12-26 11:04:05 -0800
committerAndroid Code Review <code-review@android.com>2010-12-26 11:04:05 -0800
commit696ea10ba8f540f8629948ab1b48817a982abfcf (patch)
tree1b2b116516830bdfd94b04e20c1106e271c851c0
parent9e523190a99323e47ac7221150a72f3f15f410a5 (diff)
parentdd7a9495421340a21e8896660f641c864e9628f8 (diff)
downloadu300-ericsson-mbm-devices.tar.gz
Merge "Don't set radio_state_unavailable when module is reset because of sim hotswap." into ericsson-mbm-devicesericsson-mbm-devices
-rw-r--r--u300-ril-sim.c12
-rw-r--r--u300-ril-sim.h3
-rw-r--r--u300-ril.c5
3 files changed, 19 insertions, 1 deletions
diff --git a/u300-ril-sim.c b/u300-ril-sim.c
index 676f7e4..00b2034 100644
--- a/u300-ril-sim.c
+++ b/u300-ril-sim.c
@@ -53,6 +53,17 @@ typedef enum {
static const struct timeval TIMEVAL_SIMPOLL = { 1, 0 };
static const struct timeval TIMEVAL_SIMRESET = { 60, 0 };
+static int sim_hotswap;
+
+int get_pending_hotswap()
+{
+ return sim_hotswap;
+}
+
+void set_pending_hotswap(int pending_hotswap)
+{
+ sim_hotswap = pending_hotswap;
+}
static void resetSim(void *param)
{
@@ -139,6 +150,7 @@ void onSimHotswap(const char *s)
setRadioState(RADIO_STATE_SIM_LOCKED_OR_ABSENT);
} else if (strcmp ("*EESIMSWAP:1", s) == 0) {
LOGD("SIM INSERTED");
+ set_pending_hotswap(1);
} else
LOGD("UNKNOWN HOT SWAP EVENT: %s", s);
}
diff --git a/u300-ril-sim.h b/u300-ril-sim.h
index c654f8d..04d86d2 100644
--- a/u300-ril-sim.h
+++ b/u300-ril-sim.h
@@ -24,6 +24,9 @@
#ifndef U300_RIL_SIM_H
#define U300_RIL_SIM_H 1
+int get_pending_hotswap();
+void set_pending_hotswap(int pending_hotswap);
+
void onSimStateChanged(const char *s);
void onSimHotswap(const char *s);
diff --git a/u300-ril.c b/u300-ril.c
index 2fefcc4..74cfc97 100644
--- a/u300-ril.c
+++ b/u300-ril.c
@@ -1234,6 +1234,8 @@ static char initializeCommon(void)
{
int err = 0;
+ set_pending_hotswap(0);
+
if (at_handshake() < 0) {
LOG_FATAL("Handshake failed!");
goto error;
@@ -1507,7 +1509,8 @@ static void onATReaderClosed()
{
LOGI("AT channel closed\n");
- setRadioState(RADIO_STATE_UNAVAILABLE);
+ if (!get_pending_hotswap())
+ setRadioState(RADIO_STATE_UNAVAILABLE);
signalCloseQueues();
}