diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cbf..afba1092 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 50832291..4e86b927 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/hellocardboard-android/build.gradle b/hellocardboard-android/build.gradle index 571db15c..220440dd 100644 --- a/hellocardboard-android/build.gradle +++ b/hellocardboard-android/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 31 + compileSdkVersion 33 lintOptions { abortOnError false } @@ -16,9 +16,9 @@ android { // // See the release notes for details. minSdkVersion 24 - targetSdkVersion 31 + targetSdkVersion 33 versionCode 1 - versionName "1.21.0" + versionName "1.22.0" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' ndk { abiFilters 'armeabi-v7a', 'arm64-v8a' diff --git a/hellocardboard-ios/HelloCardboard-Info.plist b/hellocardboard-ios/HelloCardboard-Info.plist index 34102458..e0785537 100644 --- a/hellocardboard-ios/HelloCardboard-Info.plist +++ b/hellocardboard-ios/HelloCardboard-Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.21.0 + 1.22.0 CFBundleVersion - 1.21.0 + 1.22.0 LSRequiresIPhoneOS NSCameraUsageDescription diff --git a/sdk/build.gradle b/sdk/build.gradle index 8bc1b6d4..6c3d00ce 100644 --- a/sdk/build.gradle +++ b/sdk/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' apply plugin: 'com.google.protobuf' android { - compileSdkVersion 31 + compileSdkVersion 33 lintOptions { abortOnError false } @@ -16,9 +16,9 @@ android { // // See the release notes for details. minSdkVersion 24 - targetSdkVersion 31 + targetSdkVersion 33 versionCode 1 - versionName "1.21.0" + versionName "1.22.0" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' ndk { abiFilters 'armeabi-v7a', 'arm64-v8a' diff --git a/sdk/cardboard.cc b/sdk/cardboard.cc index a089fe77..b01704c2 100644 --- a/sdk/cardboard.cc +++ b/sdk/cardboard.cc @@ -28,6 +28,7 @@ #include "util/logging.h" #ifdef __ANDROID__ #include "device_params/android/device_params.h" +#include "jni_utils/android/jni_utils.h" #endif // TODO(b/134142617): Revisit struct/class hierarchy. @@ -111,6 +112,7 @@ void Cardboard_initializeAndroid(JavaVM* vm, jobject context) { vm->GetEnv((void**)&env, JNI_VERSION_1_6); jobject global_context = env->NewGlobalRef(context); + cardboard::jni::initializeAndroid(vm, global_context); cardboard::qrcode::initializeAndroid(vm, global_context); cardboard::screen_params::initializeAndroid(vm, global_context); cardboard::DeviceParams::initializeAndroid(vm, global_context); @@ -323,6 +325,12 @@ void CardboardQrCode_getSavedDeviceParams(uint8_t** encoded_device_params, } std::vector device_params = cardboard::qrcode::getCurrentSavedDeviceParams(); + if (device_params.empty()) { + CARDBOARD_LOGD("No device parameters currently saved."); + *size = 0; + *encoded_device_params = nullptr; + return; + } *size = static_cast(device_params.size()); *encoded_device_params = new uint8_t[*size]; memcpy(*encoded_device_params, &device_params[0], *size); diff --git a/sdk/qrcode/android/qr_code.cc b/sdk/qrcode/android/qr_code.cc index 00ca8a29..60278e44 100644 --- a/sdk/qrcode/android/qr_code.cc +++ b/sdk/qrcode/android/qr_code.cc @@ -17,6 +17,7 @@ #include +#include #include #include "jni_utils/android/jni_utils.h" @@ -25,6 +26,13 @@ JNIEXPORT return_type JNICALL \ Java_com_google_cardboard_sdk_##clazz##_##method_name +extern "C" { + +JNI_METHOD(void, QrCodeCaptureActivity, nativeIncrementDeviceParamsChangedCount) +(JNIEnv* /*env*/, jobject /*obj*/); + +} // extern "C" + namespace cardboard::qrcode { namespace { @@ -35,6 +43,13 @@ jclass intent_class_; jclass component_name_class_; std::atomic device_params_changed_count_(0); +static const std::array + kMethods_com_google_cardboard_sdk_QrCodeCaptureActivity = { + {{"nativeIncrementDeviceParamsChangedCount", "()V", + reinterpret_cast( + Java_com_google_cardboard_sdk_QrCodeCaptureActivity_nativeIncrementDeviceParamsChangedCount)}}, +}; + // TODO(b/180938531): Release these global references. void LoadJNIResources(JNIEnv* env) { cardboard_params_utils_class_ = @@ -44,12 +59,21 @@ void LoadJNIResources(JNIEnv* env) { cardboard::jni::LoadJClass(env, "android/content/Intent"))); component_name_class_ = reinterpret_cast(env->NewGlobalRef( cardboard::jni::LoadJClass(env, "android/content/ComponentName"))); -} -void IncrementDeviceParamsChangedCount() { - device_params_changed_count_++; + // Registering native methods used within the SDK by the Java class + // QrCodeCaptureActivity. See + // https://developer.android.com/training/articles/perf-jni#native-libraries + jclass qr_code_scanner_activity_name_class = + reinterpret_cast(cardboard::jni::LoadJClass( + env, "com/google/cardboard/sdk/QrCodeCaptureActivity")); + env->RegisterNatives( + qr_code_scanner_activity_name_class, + kMethods_com_google_cardboard_sdk_QrCodeCaptureActivity.data(), + kMethods_com_google_cardboard_sdk_QrCodeCaptureActivity.size()); } +void IncrementDeviceParamsChangedCount() { device_params_changed_count_++; } + } // anonymous namespace void initializeAndroid(JavaVM* vm, jobject context) { diff --git a/sdk/rendering/opengl_es2_distortion_renderer.cc b/sdk/rendering/opengl_es2_distortion_renderer.cc index 92fb2f2b..481c2002 100644 --- a/sdk/rendering/opengl_es2_distortion_renderer.cc +++ b/sdk/rendering/opengl_es2_distortion_renderer.cc @@ -16,6 +16,11 @@ #include #include +#ifdef CARDBOARD_USE_CUSTOM_GL_BINDINGS +// If required, add a configuration header file with the OpenGL ES 2.0 binding +// customization. +#include "opengl_es2_custom_bindings.h" +#else #ifdef __ANDROID__ #include #endif @@ -25,6 +30,7 @@ #ifdef __ANDROID__ #include #endif +#endif // CARDBOARD_USE_CUSTOM_GL_BINDINGS #include "distortion_renderer.h" #include "include/cardboard.h" #include "util/is_arg_null.h" diff --git a/sdk/rendering/opengl_es3_distortion_renderer.cc b/sdk/rendering/opengl_es3_distortion_renderer.cc index 7d039d92..d6fa372e 100644 --- a/sdk/rendering/opengl_es3_distortion_renderer.cc +++ b/sdk/rendering/opengl_es3_distortion_renderer.cc @@ -19,6 +19,11 @@ #include #include +#ifdef CARDBOARD_USE_CUSTOM_GL_BINDINGS +// If required, add a configuration header file with the OpenGL ES 3.0 binding +// customization. +#include "opengl_es3_custom_bindings.h" +#else #ifdef __ANDROID__ #include #endif @@ -28,6 +33,7 @@ #ifdef __ANDROID__ #include #endif +#endif // CARDBOARD_USE_CUSTOM_GL_BINDINGS #include "distortion_renderer.h" #include "include/cardboard.h" #include "util/is_arg_null.h" diff --git a/sdk/screen_params/ios/screen_params.mm b/sdk/screen_params/ios/screen_params.mm index 3546a249..200ff84a 100644 --- a/sdk/screen_params/ios/screen_params.mm +++ b/sdk/screen_params/ios/screen_params.mm @@ -59,6 +59,10 @@ NSString *const kGIPDeviceGenerationiPhone14Plus = @"iPhone 14 Plus"; NSString *const kGIPDeviceGenerationiPhone14Pro = @"iPhone 14 Pro"; NSString *const kGIPDeviceGenerationiPhone14ProMax = @"iPhone 14 Pro Max"; +NSString *const kGIPDeviceGenerationiPhone15 = @"iPhone 15"; +NSString *const kGIPDeviceGenerationiPhone15Plus = @"iPhone 15 Plus"; +NSString *const kGIPDeviceGenerationiPhone15Pro = @"iPhone 15 Pro"; +NSString *const kGIPDeviceGenerationiPhone15ProMax = @"iPhone 15 Pro Max"; // iPod touch Generations. NSString *const kGIPDeviceGenerationiPodTouch7thGen = @"iPod touch (7th generation)"; @@ -132,6 +136,10 @@ CGFloat getDpi() { @"iPhone14,8" : kGIPDeviceGenerationiPhone14Plus, @"iPhone15,2" : kGIPDeviceGenerationiPhone14Pro, @"iPhone15,3" : kGIPDeviceGenerationiPhone14ProMax, + @"iPhone15,4" : kGIPDeviceGenerationiPhone15, + @"iPhone15,5" : kGIPDeviceGenerationiPhone15Plus, + @"iPhone16,1" : kGIPDeviceGenerationiPhone15Pro, + @"iPhone16,2" : kGIPDeviceGenerationiPhone15ProMax, @"iPod9,1" : kGIPDeviceGenerationiPodTouch7thGen, }; NSString *model = models[modelName]; @@ -177,6 +185,10 @@ CGFloat getDpi() { kGIPDeviceGenerationiPhone14Plus : @(kIPhoneOledDpi), kGIPDeviceGenerationiPhone14Pro : @(kIPhone12Dpi), kGIPDeviceGenerationiPhone14ProMax : @(kIPhone12Dpi), + kGIPDeviceGenerationiPhone15 : @(kIPhone12Dpi), + kGIPDeviceGenerationiPhone15Plus : @(kIPhone12Dpi), + kGIPDeviceGenerationiPhone15Pro : @(kIPhone12Dpi), + kGIPDeviceGenerationiPhone15ProMax : @(kIPhone12Dpi), kGIPDeviceGenerationiPodTouch7thGen : @(kDefaultDpi), }; diff --git a/sdk/unity/xr_unity_plugin/vulkan/vulkan_renderer.cc b/sdk/unity/xr_unity_plugin/vulkan/vulkan_renderer.cc index e7bf9719..cd907bd2 100644 --- a/sdk/unity/xr_unity_plugin/vulkan/vulkan_renderer.cc +++ b/sdk/unity/xr_unity_plugin/vulkan/vulkan_renderer.cc @@ -688,11 +688,14 @@ class VulkanRenderer : public Renderer { .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = image, - .subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, - .subresourceRange.baseMipLevel = 0, - .subresourceRange.levelCount = 1, - .subresourceRange.baseArrayLayer = 0, - .subresourceRange.layerCount = 1, + .subresourceRange = + { + .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, + .baseMipLevel = 0, + .levelCount = 1, + .baseArrayLayer = 0, + .layerCount = 1, + }, }; VkPipelineStageFlags source_stage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; diff --git a/third_party/unity_plugin_api/bluze.textproto b/third_party/unity_plugin_api/bluze.textproto new file mode 100644 index 00000000..a7e27b44 --- /dev/null +++ b/third_party/unity_plugin_api/bluze.textproto @@ -0,0 +1,36 @@ +# proto-file: devtools/blueprint/blueprint_file.proto +# proto-message: BlueprintFile +# DO NOT EDIT! Regenerate the contents by running go/bluze after changing any BUILD file or the Blueprint. +# Override the default values in third_party.unity.pluginapi.blueprint instead. + +buildable_unit: { + name: "third_party.unity.pluginapi" + build_pattern: "//third_party/unity/PluginApi/..." + test_pattern: "//third_party/unity/PluginApi/..." + test_tag_filter: "-nofastbuild" + build_tag_filter: "-nofastbuild" + enable_coverage: true + enable_presubmit: true + enable_continuous_build: true + continuous_build_email: { + build_cop_email_id: "arcore-build-infra+buildgardener@google.com" + } + enable_release: false +} +buildable_unit: { + name: "third_party.unity.pluginapi.opt" + test_pattern: "//third_party/unity/PluginApi/..." + test_tag_filter: "-noopt" + build_flag: "--compilation_mode=opt" + enable_coverage: false + enable_presubmit: false + enable_continuous_build: false + continuous_build_email: { + build_cop_email_id: "arcore-build-infra+buildgardener@google.com" + } + enable_release: false + [tap.tap_settings]: { + on_demand: true + on_demand_frequency: EVERY_4_HOURS + } +} diff --git a/third_party/unity_plugin_api/third_party.unity.pluginapi.blueprint b/third_party/unity_plugin_api/third_party.unity.pluginapi.blueprint new file mode 100644 index 00000000..055a8f98 --- /dev/null +++ b/third_party/unity_plugin_api/third_party.unity.pluginapi.blueprint @@ -0,0 +1,19 @@ +include "devtools/blueprint/bluze/public/bluze.ncl"; +include bytes "third_party/unity/PluginApi/bluze.textproto" as textproto; + +// See go/bluze/guide before editing. To check the generated final blueprint run +// rncl third_party/unity/PluginApi/third_party.unity.pluginapi.blueprint printproto blueprint_file + +blueprint_file = ::bluze::BlueprintFile( + textproto, + + project_name = "third_party.unity.pluginapi", + teams_product_id = 1134145041667, + tech_lead = ["jfinder"], + dev_mailing_list = "arcore-build-infra@google.com", + mdb_groups = ["third-party-tap-forge"], + buganizer_component_ids = [437622], + metadata_path = "//depot/google3/third_party/unity/PluginApi/METADATA", + +// Customize your blueprint here: go/blueprint/howto-write. +);