-
Notifications
You must be signed in to change notification settings - Fork 0
/
verizon.patch
99 lines (95 loc) · 4.7 KB
/
verizon.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
From 26b8abddc6ae5f06cc1967b7188862ed511070ee Mon Sep 17 00:00:00 2001
From: Wileen Chiu <wileenc@codeaurora.org>
Date: Tue, 12 Jun 2018 14:32:08 -0700
Subject: [PATCH] Update external card state based on current app
- Before setting and broadcasting READY
state, Telephony checks all supported
UiccCardApplications instead of only the current app state
- Telephony expects all apps reported through
GET_SIM_STATUS should move to READY, however,
this expectation is not correct.
- For example, in the case where a CDMAless MBN is flashed,
and CDMA is not supported, the SIM card reports
a CSIM app. It will remain in DETECTED state and thus,
Telephony never broadcasts the relevant state.
- Use legacy implementation, and broadcast READY state
based on the current app. Broadcast LOADED state once
all apps that have moved to READY have finished loading.
Change-Id: I12ffcc0dc0518f78b6753b8741ccae421e0466bd
CRs-Fixed: 2203384
---
.../internal/telephony/uicc/UiccProfile.java | 44 +++++--------------
1 file changed, 11 insertions(+), 33 deletions(-)
diff --git a/src/java/com/android/internal/telephony/uicc/UiccProfile.java b/src/java/com/android/internal/telephony/uicc/UiccProfile.java
index efde074e54..ae7b7d30b8 100644
--- a/src/java/com/android/internal/telephony/uicc/UiccProfile.java
+++ b/src/java/com/android/internal/telephony/uicc/UiccProfile.java
@@ -608,24 +608,16 @@ public void updateExternalState() {
break;
case APPSTATE_READY:
checkAndUpdateIfAnyAppToBeIgnored();
- if (areAllApplicationsReady()) {
- if (areAllRecordsLoaded() && areCarrierPriviligeRulesLoaded()) {
- if (VDBG) log("updateExternalState: setting state to LOADED");
- setExternalState(IccCardConstants.State.LOADED);
- } else {
- if (VDBG) {
- log("updateExternalState: setting state to READY; records loaded "
- + areAllRecordsLoaded() + ", carrier privilige rules loaded "
- + areCarrierPriviligeRulesLoaded());
- }
- setExternalState(IccCardConstants.State.READY);
- }
+ if (areReadyAppsRecordsLoaded() && areCarrierPriviligeRulesLoaded()) {
+ if (VDBG) log("updateExternalState: setting state to LOADED");
+ setExternalState(IccCardConstants.State.LOADED);
} else {
if (VDBG) {
- log("updateExternalState: app state is READY but not for all apps; "
- + "setting state to NOT_READY");
+ log("updateExternalState: setting state to READY; records loaded "
+ + areReadyAppsRecordsLoaded() + ", carrier privilige rules loaded "
+ + areCarrierPriviligeRulesLoaded());
}
- setExternalState(IccCardConstants.State.NOT_READY);
+ setExternalState(IccCardConstants.State.READY);
}
break;
}
@@ -1171,33 +1163,19 @@ private void checkAndUpdateIfAnyAppToBeIgnored() {
}
}
- private boolean areAllApplicationsReady() {
+ private boolean areReadyAppsRecordsLoaded() {
for (UiccCardApplication app : mUiccApplications) {
- if (app != null && isSupportedApplication(app) && !app.isReady()
+ if (app != null && isSupportedApplication(app) && app.isReady()
&& !app.isAppIgnored()) {
- if (VDBG) log("areAllApplicationsReady: return false");
- return false;
- }
- }
-
- if (VDBG) {
- log("areAllApplicationsReady: outside loop, return " + (mUiccApplication != null));
- }
- return mUiccApplication != null;
- }
-
- private boolean areAllRecordsLoaded() {
- for (UiccCardApplication app : mUiccApplications) {
- if (app != null && isSupportedApplication(app) && !app.isAppIgnored()) {
IccRecords ir = app.getIccRecords();
if (ir == null || !ir.isLoaded()) {
- if (VDBG) log("areAllRecordsLoaded: return false");
+ if (VDBG) log("areReadyAppsRecordsLoaded: return false");
return false;
}
}
}
if (VDBG) {
- log("areAllRecordsLoaded: outside loop, return " + (mUiccApplication != null));
+ log("areReadyAppsRecordsLoaded: outside loop, return " + (mUiccApplication != null));
}
return mUiccApplication != null;
}