diff options
| -rw-r--r-- | core/tests/coretests/src/android/os/SetPersistentVrThreadTest.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/tests/coretests/src/android/os/SetPersistentVrThreadTest.java b/core/tests/coretests/src/android/os/SetPersistentVrThreadTest.java index 920988be2eb3..9e445541ad3a 100644 --- a/core/tests/coretests/src/android/os/SetPersistentVrThreadTest.java +++ b/core/tests/coretests/src/android/os/SetPersistentVrThreadTest.java @@ -24,7 +24,6 @@ import android.os.Process; import android.provider.Settings; import android.test.ActivityInstrumentationTestCase2; import android.test.suitebuilder.annotation.SmallTest; -import android.util.Log; /** * Tests ActivityManager#setPersistentVrThread and ActivityManager#setVrThread's @@ -76,9 +75,11 @@ public class SetPersistentVrThreadTest extends ActivityInstrumentationTestCase2< } private void setPersistentVrModeEnabled(boolean enable) throws Throwable { - mVrManager.setPersistentVrModeEnabled(enable); - // Allow the system time to send out callbacks for persistent VR mode. - Thread.sleep(200); + if (mVrManager != null) { + mVrManager.setPersistentVrModeEnabled(enable); + // Allow the system time to send out callbacks for persistent VR mode. + Thread.sleep(200); + } } @SmallTest |