Skip to content

fix: sync qs tile code between ims and volte#431

Open
yhkee0404 wants to merge 1 commit intokyujin-cho:mainfrom
yhkee0404:sync-code-qs-tile-services
Open

fix: sync qs tile code between ims and volte#431
yhkee0404 wants to merge 1 commit intokyujin-cho:mainfrom
yhkee0404:sync-code-qs-tile-services

Conversation

@yhkee0404
Copy link
Copy Markdown
Contributor

@yhkee0404 yhkee0404 commented Dec 13, 2025

private val imsActivated: Boolean? get() {
/*
* true: VoLTE enabled
* false: VoLTE disabled

private val volteEnabled: Boolean? get() {
/*
* true: VoLTE enabled
* false: VoLTE disabled

You can download and test the built apk here but need to uninstall the previous release if any: https://github.com/yhkee0404/pixel-volte-patch/releases/tag/1.3.1_PR_426_430_431_432

Comment on lines -62 to -73
override fun onStartListening() {
super.onStartListening()
private fun refreshStatus(volteEnabled: Boolean?) {
qsTile.state =
when (this.volteEnabled) {
when (volteEnabled) {
true -> Tile.STATE_ACTIVE
false -> Tile.STATE_INACTIVE
null -> Tile.STATE_UNAVAILABLE
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
qsTile.subtitle =
getString(
when (this.volteEnabled) {
Copy link
Copy Markdown
Contributor Author

@yhkee0404 yhkee0404 Dec 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't here a race condition when the second read value of volteEnabled may get different from the first one and become a non-repeatable read? On the contrary, the similar updates from volteEnabled inside toggleVoLTEStatus or those from imsActivated inside IMSStatusQSTileService.refreshStatus have no bugs like this one.

@yhkee0404 yhkee0404 changed the title refactor: sync qs tile code between ims and volte fix: sync qs tile code between ims and volte Dec 13, 2025
@yhkee0404 yhkee0404 marked this pull request as ready for review December 13, 2025 07:23
Copy link
Copy Markdown
Contributor Author

@yhkee0404 yhkee0404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we should catch IllegalStateException thrown from Shizuku according to its README:

try {
if (checkShizukuPermission(0) == ShizukuStatus.GRANTED && carrierModer.deviceSupportsIMS) {
val sub =
carrierModer.getActiveSubscriptionInfoForSimSlotIndex(this.simSlotIndex)
?: return null
return SubscriptionModer(this.applicationContext, sub.subscriptionId)
}
} catch (_: IllegalStateException) {
}

try {
if (checkShizukuPermission(0) == ShizukuStatus.GRANTED && carrierModer.deviceSupportsIMS) {
carrierModer.subscriptions
val sub =
carrierModer.getActiveSubscriptionInfoForSimSlotIndex(this.simSlotIndex)
?: return null
return SubscriptionModer(this.applicationContext, sub.subscriptionId)
}
} catch (_: IllegalStateException) {
}

But why do you catch IllegalStateException for moder.isIMSRegistered or moder.isVoLteConfigEnabled?:

try {
return moder.isIMSRegistered
} catch (_: IllegalStateException) {
}

try {
return moder.isVoLteConfigEnabled
} catch (_: IllegalStateException) {
}

@yhkee0404 yhkee0404 force-pushed the sync-code-qs-tile-services branch from c716107 to 2007122 Compare December 20, 2025 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant