Assigned
Status Update
Comments
vi...@google.com <vi...@google.com> #2
Information redacted by Android Beta Feedback.
mu...@gmail.com <mu...@gmail.com> #3
Thank you for reporting this issue. For us to further investigate this issue, please provide the following additional information:
Complete steps to reproduce
What steps do others need to take in order to reproduce the issue themselves?
Current output (Error message if any)
What do you see instead?
Screen Record of the Issue
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue
Note: Please upload the files to google drive and share the folder to android-bugreport@google.com, then share the link here.
Complete steps to reproduce
What steps do others need to take in order to reproduce the issue themselves?
Current output (Error message if any)
What do you see instead?
Screen Record of the Issue
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue
Note: Please upload the files to google drive and share the folder to android-bugreport@google.com, then share the link here.
Description
2. CTS tool version: 15_r2
3. Module :- CtsDevicePolicyTestCases
4. Steps to quickly reproduce the issue for a particular class :
run cts --include-filter "CtsDevicePolicyTestCases android.devicepolicy.cts.SystemErrorDialogsTest"
5. Issue description:
My device is Android 15 launch device(with AOSP r1 tag), based on x86_64 architecture.
While running this module, I encountered an issue where the teardown of the classes are not completing due to a NullPointerException. This exception occurs when attempting to restore the global settings, secure settings and properties.
For example, In "SystemErrorDialogsTest" class , annotations are used to set the global and secure setting values like
@EnsureSecureSettingSet(key = SHOW_FIRST_CRASH_DIALOG_DEV_OPTION, value = "1")
@EnsureGlobalSettingSet(key = Settings.Global.ACTIVITY_MANAGER_CONSTANTS, value = "min_crash_interval=500")
However, before applying this setting, the original value is stored, which is currently returning null. As a result, during the teardown process, this null value is being restored, leading to the exception being thrown. This issue is affecting other test case in different class and modules.
I noticed that the settings are not initialized anywhere in the source code.
Similarly, this issue is getting for other classes like DefaultSmsApplicationTest , BugReportTest(while restoring property which is not initialized).
Teardown Failure Logs:
01-06 06:42:25.491 10094 13195 13207 E TestRunner: failed: android.devicepolicy.cts.SystemErrorDialogsTest
01-06 06:42:25.491 10094 13195 13207 E TestRunner: ----- begin exception -----
01-06 06:42:25.491 10094 13195 13207 E TestRunner: java.lang.NullPointerException: Parameter specified as non-null is null: method com.android.bedstead.nene.settings.GlobalSettings.putString, parameter value
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at com.android.bedstead.nene.settings.GlobalSettings.putString(Unknown Source:7)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at com.android.bedstead.harrier.DeviceState.teardownShareableState(DeviceState.java:1864)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at com.android.bedstead.harrier.DeviceState.-$$Nest$mteardownShareableState(Unknown Source:0)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at com.android.bedstead.harrier.DeviceState$2.evaluate(DeviceState.java:1024)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at org.junit.rules.RunRules.evaluate(RunRules.java:20)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at org.junit.runners.Suite.runChild(Suite.java:128)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at org.junit.runners.Suite.runChild(Suite.java:27)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at org.junit.runners.ParentRunner.-$$Nest$mrunChildren(Unknown Source:0)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:68)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:59)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:463)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2594)
01-06 06:42:25.491 10094 13195 13207 E TestRunner: ----- end exception -----
6. What you think the correct behavior should be?
The teardown of the classes must be completed.
7. How it can be fixed?
Exception handling can be added while restoring the original values in teardownShareableState() of DeviceState.java like specified in solution.txt
8. BugReport link: