Skip to content

Commit

Permalink
Remove check for FEATURE_TELEPHONY_SUBSCRIPTION
Browse files Browse the repository at this point in the history
OxygenOS doesn't advertise support for it, but supports it anyway. Let's
just assume that all Android versions capable of supporting
SubscriptionManager actually support it. AOSP's Settings app doesn't
check for this feature either.

Fixes: #649

Signed-off-by: Andrew Gunnerson <[email protected]>
  • Loading branch information
chenxiaolong committed Jan 4, 2025
1 parent c52cc13 commit 090280e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,7 @@ class CallMetadataCollector(

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R
&& context.checkSelfPermission(Manifest.permission.READ_PHONE_STATE)
== PackageManager.PERMISSION_GRANTED
&& context.packageManager.hasSystemFeature(
PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION)) {
== PackageManager.PERMISSION_GRANTED) {
val subscriptionManager = context.getSystemService(SubscriptionManager::class.java)

val telephonyManager = context.getSystemService(TelephonyManager::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,7 @@ class RecordRuleEditorBottomSheet : BottomSheetDialogFragment(),

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R
&& context.checkSelfPermission(Manifest.permission.READ_PHONE_STATE)
== PackageManager.PERMISSION_GRANTED
&& context.packageManager.hasSystemFeature(
PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION)) {
== PackageManager.PERMISSION_GRANTED) {
val subscriptionManager = context.getSystemService(SubscriptionManager::class.java)

val actualSimCount = subscriptionManager.activeSubscriptionInfoCount
Expand Down

0 comments on commit 090280e

Please sign in to comment.