Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Silence-Android
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
268
Issues
268
List
Boards
Labels
Service Desk
Milestones
Merge Requests
11
Merge Requests
11
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Silence
Silence-Android
Commits
ed5caca4
Commit
ed5caca4
authored
Apr 17, 2020
by
Bastien Le Querrec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve update for >24 APIs
parent
dcd0e28f
Pipeline
#163
passed with stages
in 43 minutes and 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
src/org/smssecure/smssecure/DatabaseUpgradeActivity.java
src/org/smssecure/smssecure/DatabaseUpgradeActivity.java
+20
-9
No files found.
src/org/smssecure/smssecure/DatabaseUpgradeActivity.java
View file @
ed5caca4
...
...
@@ -23,7 +23,6 @@ import android.content.pm.PackageManager;
import
android.os.AsyncTask
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.telephony.SubscriptionInfo
;
import
android.telephony.SubscriptionManager
;
import
android.util.Log
;
import
android.view.View
;
...
...
@@ -157,20 +156,32 @@ public class DatabaseUpgradeActivity extends BaseActivity {
if
(
params
[
0
]
<
MULTI_SIM_MULTI_KEYS_VERSION
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
22
)
{
int
eligibleDeviceSubscriptionId
=
-
1
;
List
<
SubscriptionInfoCompat
>
subscriptionInfoList
=
SubscriptionManagerCompat
.
from
(
context
).
getActiveSubscriptionInfoList
();
/*
* getDefaultSubscriptionId() is available for API 24+ only, so we
* move keys and sessions to SIM card in the first available slot,
* not to the default one.
* not to the default one, on API < 24 or if getDefaultSubscriptionId()
* returns INVALID_SUBSCRIPTION_ID.
*/
List
<
SubscriptionInfoCompat
>
subscriptionInfoList
=
SubscriptionManagerCompat
.
from
(
context
).
getActiveSubscriptionInfoList
();
int
smallerSlot
=
-
1
;
int
eligibleDeviceSubscriptionId
=
-
1
;
if
(
Build
.
VERSION
.
SDK_INT
>=
24
)
eligibleDeviceSubscriptionId
=
SubscriptionManager
.
from
(
context
).
getDefaultSubscriptionId
();
for
(
SubscriptionInfoCompat
subscriptionInfo
:
subscriptionInfoList
)
{
if
(
smallerSlot
==
-
1
||
subscriptionInfo
.
getIccSlot
()
<
smallerSlot
)
{
smallerSlot
=
subscriptionInfo
.
getIccSlot
();
eligibleDeviceSubscriptionId
=
subscriptionInfo
.
getDeviceSubscriptionId
();
if
(
eligibleDeviceSubscriptionId
==
-
1
)
{
int
smallerSlot
=
-
1
;
for
(
SubscriptionInfoCompat
subscriptionInfo
:
subscriptionInfoList
)
{
if
(
smallerSlot
==
-
1
||
subscriptionInfo
.
getIccSlot
()
<
smallerSlot
)
{
smallerSlot
=
subscriptionInfo
.
getIccSlot
();
eligibleDeviceSubscriptionId
=
subscriptionInfo
.
getDeviceSubscriptionId
();
}
}
Log
.
w
(
TAG
,
"smallerSlot: "
+
smallerSlot
);
Log
.
w
(
TAG
,
"eligibleDeviceSubscriptionId: "
+
eligibleDeviceSubscriptionId
);
}
DualSimUtil
.
moveIdentityKeysAndSessionsToSubscriptionId
(
context
,
-
1
,
eligibleDeviceSubscriptionId
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment