diff --git a/native/cocos/platform/android/AndroidPlatform.cpp b/native/cocos/platform/android/AndroidPlatform.cpp index 5924866986..e6c43d5c81 100644 --- a/native/cocos/platform/android/AndroidPlatform.cpp +++ b/native/cocos/platform/android/AndroidPlatform.cpp @@ -517,9 +517,8 @@ int AndroidPlatform::init() { _loopTimeOut = LOW_FREQUENCY_TIME_INTERVAL; _isLowFrequencyLoopEnabled = true; IXRInterface *xr = getInterface(); - bool isXRInstanceCreated = xr && xr->getXRConfig(xr::XRConfigKey::INSTANCE_CREATED).getBool(); - if (!isXRInstanceCreated) { - // xr will not sleep, -1 we will block forever waiting for events. + if (xr && !xr->getXRConfig(xr::XRConfigKey::INSTANCE_CREATED).getBool()) { + // xr will sleep, -1 we will block forever waiting for events. _loopTimeOut = -1; _isLowFrequencyLoopEnabled = false; }