-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix(android): support non-rooted OnePlus 12 / OxygenOS 16 #453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 14 commits
fa02d4f
46d19c5
aff8014
58b15fb
b162ee5
8c287b5
7e52ae2
dde12db
725cfb7
aadcaf1
b1a1fea
5e6bcb6
6211c4c
bc5a12b
aa3db92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| .worktrees/ | ||
| root-module/radare2-5.9.9-android-aarch64.tar.gz | ||
| wak.toml | ||
| log.txt | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -52,6 +52,7 @@ import androidx.compose.material3.Text | |||||||||||||||||||||
| import androidx.compose.material3.VerticalDivider | ||||||||||||||||||||||
| import androidx.compose.runtime.Composable | ||||||||||||||||||||||
| import androidx.compose.runtime.getValue | ||||||||||||||||||||||
| import androidx.compose.runtime.DisposableEffect | ||||||||||||||||||||||
| import androidx.compose.runtime.mutableFloatStateOf | ||||||||||||||||||||||
| import androidx.compose.runtime.mutableStateOf | ||||||||||||||||||||||
| import androidx.compose.runtime.remember | ||||||||||||||||||||||
|
|
@@ -170,14 +171,21 @@ fun NoiseControlSettings( | |||||||||||||||||||||
| } | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| val noiseControlIntentFilter = IntentFilter().apply { | ||||||||||||||||||||||
| addAction(AirPodsNotifications.ANC_DATA) | ||||||||||||||||||||||
| addAction(AirPodsNotifications.DISCONNECT_RECEIVERS) | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { | ||||||||||||||||||||||
| context.registerReceiver(noiseControlReceiver, noiseControlIntentFilter, Context.RECEIVER_EXPORTED) | ||||||||||||||||||||||
| } else { | ||||||||||||||||||||||
| context.registerReceiver(noiseControlReceiver, noiseControlIntentFilter) | ||||||||||||||||||||||
| DisposableEffect(Unit) { | ||||||||||||||||||||||
| val noiseControlIntentFilter = IntentFilter().apply { | ||||||||||||||||||||||
| addAction(AirPodsNotifications.ANC_DATA) | ||||||||||||||||||||||
| addAction(AirPodsNotifications.DISCONNECT_RECEIVERS) | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { | ||||||||||||||||||||||
| context.registerReceiver(noiseControlReceiver, noiseControlIntentFilter, Context.RECEIVER_EXPORTED) | ||||||||||||||||||||||
| } else { | ||||||||||||||||||||||
| context.registerReceiver(noiseControlReceiver, noiseControlIntentFilter) | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
Comment on lines
+179
to
+183
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cd android && find . -name "NoiseControlSettings.kt" -type fRepository: kavishdevar/librepods Length of output: 145 🏁 Script executed: cd android && git ls-files | grep -i noiseRepository: kavishdevar/librepods Length of output: 541 🏁 Script executed: find . -name "NoiseControlSettings.kt" -type fRepository: kavishdevar/librepods Length of output: 153 🏁 Script executed: cat -n android/app/src/main/java/me/kavishdevar/librepods/composables/NoiseControlSettings.kt | head -200 | tail -50Repository: kavishdevar/librepods Length of output: 2379 🏁 Script executed: cat -n android/app/src/main/java/me/kavishdevar/librepods/composables/NoiseControlSettings.kt | head -100Repository: kavishdevar/librepods Length of output: 5178 🏁 Script executed: find . -name "AirPodsNotifications.kt" -type fRepository: kavishdevar/librepods Length of output: 47 🏁 Script executed: rg "ANC_DATA|DISCONNECT_RECEIVERS" --type ktRepository: kavishdevar/librepods Length of output: 91 🏁 Script executed: rg "sendBroadcast" --type kt -A 3 -B 3Repository: kavishdevar/librepods Length of output: 91 🏁 Script executed: find . -name "*AirPodsNotifications*" -type fRepository: kavishdevar/librepods Length of output: 47 🏁 Script executed: find . -name "*Notification*" -type f | grep -i airpodsRepository: kavishdevar/librepods Length of output: 47 🏁 Script executed: rg "ANC_DATA|DISCONNECT_RECEIVERS" -A 2 -B 2Repository: kavishdevar/librepods Length of output: 14838 🏁 Script executed: rg "sendBroadcast" -A 3 -B 3Repository: kavishdevar/librepods Length of output: 20765 Use Suggested fix- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
- context.registerReceiver(noiseControlReceiver, noiseControlIntentFilter, Context.RECEIVER_EXPORTED)
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
+ context.registerReceiver(noiseControlReceiver, noiseControlIntentFilter, Context.RECEIVER_NOT_EXPORTED)
} else {
context.registerReceiver(noiseControlReceiver, noiseControlIntentFilter)
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| onDispose { | ||||||||||||||||||||||
| try { | ||||||||||||||||||||||
| context.unregisterReceiver(noiseControlReceiver) | ||||||||||||||||||||||
| } catch (_: IllegalArgumentException) { } | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| Box( | ||||||||||||||||||||||
| modifier = Modifier | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.