Skip to content
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

Catch new NPE when querying app sizes on Android 15 #1442

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

d4rken
Copy link
Member

@d4rken d4rken commented Oct 28, 2024

Reported for a Pixel 8 Pro @ Android 15.
Couldn't reproduce myself

According to the log only happened to one app (SnapChat), but several apps before that didn't throw an NPE.

java.lang.NullPointerException
	at android.os.Parcel.createExceptionOrNull(Parcel.java:3248)
	at android.os.Parcel.createException(Parcel.java:3226)
	at android.os.Parcel.readException(Parcel.java:3209)
	at android.os.Parcel.readException(Parcel.java:3151)
	at android.app.usage.IStorageStatsManager$Stub$Proxy.queryStatsForPackage(IStorageStatsManager.java:505)
	at android.app.usage.StorageStatsManager.queryStatsForPackage(StorageStatsManager.java:211)
	at eu.darken.sdmse.appcontrol.core.AppControl.toAppInfo(Unknown Source:268)
	at eu.darken.sdmse.appcontrol.core.AppControl.performScan(Unknown Source:351)
	at eu.darken.sdmse.appcontrol.core.AppControl.submit(Unknown Source:216)
	at eu.darken.sdmse.main.core.taskmanager.TaskManager$execute$2$result$1.invokeSuspend(Unknown Source:32)
	at eu.darken.sdmse.main.core.taskmanager.TaskManager$execute$2$result$1.invoke(Unknown Source:10)
	at kotlin.ResultKt.useRes(Unknown Source:93)
	at eu.darken.sdmse.common.sharedresource.HasSharedResource.useRes(Unknown Source:4)
	at eu.darken.sdmse.main.core.taskmanager.TaskManager.access$execute(Unknown Source:239)
	at eu.darken.sdmse.main.core.taskmanager.TaskManager$submit$job$1.invokeSuspend(Unknown Source:133)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Unknown Source:8)
	at kotlinx.coroutines.UndispatchedCoroutine.afterResume(Unknown Source:53)
	at kotlinx.coroutines.AbstractCoroutine.resumeWith(Unknown Source:22)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Unknown Source:31)
	at kotlinx.coroutines.DispatchedTask.run(Unknown Source:112)
	at androidx.work.Worker$2.run(Unknown Source:53)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Unknown Source:2)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(Unknown Source:95)
Caused by: android.os.RemoteException: Remote stack trace:
	at java.io.File.<init>(File.java:288)
	at com.android.server.usage.StorageStatsService.computeAppStatsByDataTypes(StorageStatsService.java:960)
	at com.android.server.usage.StorageStatsService.queryStatsForUid(StorageStatsService.java:456)
	at com.android.server.usage.StorageStatsService.queryStatsForPackage(StorageStatsService.java:383)
	at android.app.usage.IStorageStatsManager$Stub.onTransact(IStorageStatsManager.java:265)

Reported for a Pixel 8 Pro @ Android 15.
Couldn't reproduce myself

According to the log only happened to one app (SnapChat), but several apps before that didn't throw an NPE.

```java
java.lang.NullPointerException
	at android.os.Parcel.createExceptionOrNull(Parcel.java:3248)
	at android.os.Parcel.createException(Parcel.java:3226)
	at android.os.Parcel.readException(Parcel.java:3209)
	at android.os.Parcel.readException(Parcel.java:3151)
	at android.app.usage.IStorageStatsManager$Stub$Proxy.queryStatsForPackage(IStorageStatsManager.java:505)
	at android.app.usage.StorageStatsManager.queryStatsForPackage(StorageStatsManager.java:211)
	at eu.darken.sdmse.appcontrol.core.AppControl.toAppInfo(Unknown Source:268)
	at eu.darken.sdmse.appcontrol.core.AppControl.performScan(Unknown Source:351)
	at eu.darken.sdmse.appcontrol.core.AppControl.submit(Unknown Source:216)
	at eu.darken.sdmse.main.core.taskmanager.TaskManager$execute$2$result$1.invokeSuspend(Unknown Source:32)
	at eu.darken.sdmse.main.core.taskmanager.TaskManager$execute$2$result$1.invoke(Unknown Source:10)
	at kotlin.ResultKt.useRes(Unknown Source:93)
	at eu.darken.sdmse.common.sharedresource.HasSharedResource.useRes(Unknown Source:4)
	at eu.darken.sdmse.main.core.taskmanager.TaskManager.access$execute(Unknown Source:239)
	at eu.darken.sdmse.main.core.taskmanager.TaskManager$submit$job$1.invokeSuspend(Unknown Source:133)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Unknown Source:8)
	at kotlinx.coroutines.UndispatchedCoroutine.afterResume(Unknown Source:53)
	at kotlinx.coroutines.AbstractCoroutine.resumeWith(Unknown Source:22)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Unknown Source:31)
	at kotlinx.coroutines.DispatchedTask.run(Unknown Source:112)
	at androidx.work.Worker$2.run(Unknown Source:53)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Unknown Source:2)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(Unknown Source:95)
Caused by: android.os.RemoteException: Remote stack trace:
	at java.io.File.<init>(File.java:288)
	at com.android.server.usage.StorageStatsService.computeAppStatsByDataTypes(StorageStatsService.java:960)
	at com.android.server.usage.StorageStatsService.queryStatsForUid(StorageStatsService.java:456)
	at com.android.server.usage.StorageStatsService.queryStatsForPackage(StorageStatsService.java:383)
	at android.app.usage.IStorageStatsManager$Stub.onTransact(IStorageStatsManager.java:265)
```
@d4rken d4rken added bug Something isn't working as expected c: AppControl labels Oct 28, 2024
@d4rken d4rken merged commit 63f9987 into main Oct 29, 2024
16 checks passed
@d4rken d4rken deleted the fix-android-15-appops-error branch October 29, 2024 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected c: AppControl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant