Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.13.1'
classpath 'com.android.tools.build:gradle:9.2.0'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.10.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
11 changes: 4 additions & 7 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 12 additions & 24 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion hellocardboard-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {
minSdkVersion = 26
targetSdkVersion = 35
versionCode 1
versionName "1.34.0"
versionName "1.35.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a'
Expand Down
4 changes: 2 additions & 2 deletions hellocardboard-ios/HelloCardboard-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.34.0</string>
<string>1.35.0</string>
<key>CFBundleVersion</key>
<string>1.34.0</string>
<string>1.35.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
Expand Down
1 change: 1 addition & 0 deletions hellocardboard-ios/HelloCardboardGlUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <random>
#include <sstream>
#include <string>
#include <assert.h>

#include "HelloCardboardFileUtils.h"

Expand Down
6 changes: 3 additions & 3 deletions paperscope/core/SupportedAppProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class SupportedAppProvider {
private List<BasicAppInfo> installedApps;

private SupportedAppProvider() {
installedApps = new ArrayList<BasicAppInfo>();
installedApps = new ArrayList<>();
}

public static SupportedAppProvider getInstance() {
Expand Down Expand Up @@ -141,11 +141,11 @@ private void appendInstalledAppsWithCardboardSupportIntent(

private List<BasicAppInfo> getSupportedAppList(PackageManager packageManager, Context context) {
// Map of package name and basicAppInfo that will be used to ensure uniqueness.
Map<String, BasicAppInfo> supportedAppsMap = new LinkedHashMap<String, BasicAppInfo>();
Map<String, BasicAppInfo> supportedAppsMap = new LinkedHashMap<>();
// Add apps that have cardboard intent.
appendInstalledAppsWithCardboardSupportIntent(packageManager, context, supportedAppsMap);

List<BasicAppInfo> supportedApps = new ArrayList<BasicAppInfo>(supportedAppsMap.values());
List<BasicAppInfo> supportedApps = new ArrayList<>(supportedAppsMap.values());
sortAppListByName(supportedApps);
return supportedApps;
}
Expand Down
2 changes: 1 addition & 1 deletion paperscope/myvideos/VideoFetcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void getLocalVideos() {
int idColumn = videoCursor.getColumnIndex(MediaStore.Video.Media._ID);
int dataColumn = videoCursor.getColumnIndex(MediaStore.Video.Media.DATA);

List<VideoInfo> videoInfoList = new ArrayList<VideoInfo>();
List<VideoInfo> videoInfoList = new ArrayList<>();
while (videoCursor.moveToNext()) {
Uri contentUri = Uri.parse(
android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI
Expand Down
4 changes: 2 additions & 2 deletions paperscope/photosphere/lightcycle/opengl/DrawableGL.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public abstract class DrawableGL {
protected ShortBuffer mIndices = null;

/** Storage for textures. */
protected Vector<TextureProvider> mTextures = new Vector<TextureProvider>();
protected Vector<TextureProvider> mTextures = new Vector<>();

/** Transformation. */
protected float[] mLocalMatrix = new float[16];
Expand Down Expand Up @@ -115,7 +115,7 @@ public void draw(float[] parentTransform, Vector3 lookAt, float minVisibilityDot
// Add a child of the drawable.
public void addChild(DrawableGL child) {
if (mChildren == null) {
mChildren = new HashSet<DrawableGL>();
mChildren = new HashSet<>();
}
mChildren.add(child);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private void generateGeometry(float radius) {
for (int x = 0, u = 0; u < textureCountX; x += tesselationFactor, ++u) {
curvedTiles[u][v] =
new CurvedTile(v + (u * textureCountY), tesselationFactor);
List<Vertex> vertexList = new ArrayList<Vertex>();
List<Vertex> vertexList = new ArrayList<>();

// For each texture, add the relevant vertices.
// TODO(haeberling): We should store vertices in a single buffer for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class TextureLoaderManager {
private Semaphore bitmapLoadingSemaphore;

private final TileProvider tileProvider;
private final List<DelayedTextureLoader> loaders = new ArrayList<DelayedTextureLoader>();
private final List<DelayedTextureLoader> loaders = new ArrayList<>();

/**
* This instance is given to all texture loaders. It's called when any of them loaded a texture
Expand Down
4 changes: 3 additions & 1 deletion sdk/qrcode/ios/sdk.bundle/resolutions.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# LINT.IfChange
identifier,device_name,dpis
iPhone1.1,iPhone,326.0f
iPhone1.2,iPhone 3G,326.0f
Expand Down Expand Up @@ -60,4 +61,5 @@ iPhone18.4,iPhone Air,460.0f
iPhone18.3,iPhone 17,460.0f
iPhone18.1,iPhone 17 Pro,460.0f
iPhone18.2,iPhone 17 Pro Max,460.0f
iPod9.1,iPod touch (7th generation),326.0f
iPod9.1,iPod touch (7th generation),326.0f
# LINT.ThenChange(//depot/google3/third_party/cardboard_oss_unity/unity_plugin/Packages/cardboard-xr-plugin/Runtime/iOS/sdk.bundle/resolutions.csv)
54 changes: 36 additions & 18 deletions sdk/screen_params/ios/screen_params.mm
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ IosScreenParamsMap loadIosScreenParamsFromFile(std::string_view filePath) {
}

std::string line;
std::getline(screenParamsFile, line); // Skip the header
while (std::getline(screenParamsFile, line)) {
if (line.starts_with('#') || line.starts_with("identifier,") || line.empty()) {
continue;
}
const std::array<std::string, 3> tokens {stringSplit(line, ',')};
screenParams[tokens.at(0)] = {tokens.at(1), strtod(tokens.at(2).c_str(), nullptr)};
}
Expand All @@ -63,28 +65,44 @@ IosScreenParamsMap loadIosScreenParamsFromFile(std::string_view filePath) {
}

CGFloat getDpi() {
// Gets model name.
struct utsname systemInfo;
uname(&systemInfo);
@autoreleasepool {
// Gets model name.
struct utsname systemInfo;
if (uname(&systemInfo) < 0) {
CARDBOARD_LOGE("uname failed.");
return kDefaultDpi;
}

NSString *machineName = [NSString stringWithCString:systemInfo.machine
encoding:NSUTF8StringEncoding];
machineName = [machineName stringByReplacingOccurrencesOfString:@"," withString:@"."];
const std::string modelName{[machineName UTF8String]};
NSString *machineName = [NSString stringWithCString:systemInfo.machine
encoding:NSUTF8StringEncoding];
if (!machineName) {
CARDBOARD_LOGE("Couldn't get machine name.");
return kDefaultDpi;
}

CARDBOARD_LOGI("Model name: %s", modelName.c_str());
machineName = [machineName stringByReplacingOccurrencesOfString:@"," withString:@"."];
const std::string modelName{[machineName UTF8String]};

const SDKBundleFinder *bundleFinder = [[SDKBundleFinder alloc] init];
const NSBundle *sdkBundle = [bundleFinder getSDKBundle];
const NSString *screenParamsFilePath = [sdkBundle pathForResource:@"resolutions" ofType:@"csv"];
const IosScreenParamsMap screenParams{loadIosScreenParamsFromFile([screenParamsFilePath UTF8String])};
CARDBOARD_LOGI("Model name: %s", modelName.c_str());

if (screenParams.find(modelName) == screenParams.end()) {
CARDBOARD_LOGE("Couldn't find screen params for model: %s", modelName.c_str());
return kDefaultDpi;
}
const SDKBundleFinder *bundleFinder = [[SDKBundleFinder alloc] init];
const NSBundle *sdkBundle = [bundleFinder getSDKBundle];
const NSString *screenParamsFilePath = [sdkBundle pathForResource:@"resolutions" ofType:@"csv"];
if (!screenParamsFilePath) {
CARDBOARD_LOGE("Couldn't find screen params file.");
return kDefaultDpi;
}

const IosScreenParamsMap screenParams{
loadIosScreenParamsFromFile([screenParamsFilePath UTF8String])};
const auto it = screenParams.find(modelName);
if (it == screenParams.end()) {
CARDBOARD_LOGE("Couldn't find screen params for model: %s", modelName.c_str());
return kDefaultDpi;
}

return screenParams.at(modelName).second;
return it->second.second;
}
}

void getScreenSizeInMeters(int width_pixels, int height_pixels, float *out_width_meters,
Expand Down