Skip to content

Commit d40c334

Browse files
authored
Merge branch 'main' into bugfix/export-crash
2 parents 821ec92 + ae4a42a commit d40c334

File tree

39 files changed

+1761
-631
lines changed

39 files changed

+1761
-631
lines changed

app/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ dependencies {
155155
implementation(projects.core.theme)
156156
implementation(projects.core.util)
157157

158+
// library must be compileOnly, see
159+
// https://developer.android.com/develop/xr/jetpack-xr-sdk/getting-started#enable-minification
160+
compileOnly(libs.androidx.xr.extensions)
161+
158162
baselineProfile(projects.benchmark)
159163

160164
// Android Instrumented Tests

build.sh

Lines changed: 54 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ set -e
2222
# --- Configuration ---
2323
# Get the script's directory.
2424
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
25-
2625
# Define the Android SDK version you want to target.
2726
ANDROID_SDK_VERSION="36"
2827
ANDROID_BUILD_TOOLS_VERSION="36.0.0"
@@ -93,49 +92,66 @@ chmod +x ./gradlew
9392
echo "INFO: Cleaning the project..."
9493
./gradlew clean -Pandroid.sdk.path=$ANDROID_HOME
9594

96-
# Build the production release bundle without generating a baseline profile.
97-
echo "INFO: Building the production release bundle..."
95+
# Build the production release bundles without generating baseline profiles.
96+
echo "INFO: Building the Android production release bundle..."
9897
./gradlew app:bundleRelease app:spdxSbomForRelease -x test -Pandroid.sdk.path=$ANDROID_HOME -PCI_BUILD=true
9998

99+
echo "INFO: Building the Wear OS production release bundle..."
100+
./gradlew wear:bundleRelease -x test -Pandroid.sdk.path=$ANDROID_HOME -PCI_BUILD=true
101+
100102
# --- Artifact Collection ---
101103
echo "INFO: Preparing artifacts for Kokoro..."
102104

103-
# Default output path for the bundle
104-
AAB_SRC_DIR="app/build/outputs/bundle/release"
105-
# The default name of the AAB for a release bundle
106-
AAB_FILE="app-release.aab"
107-
AAB_PATH="${AAB_SRC_DIR}/${AAB_FILE}"
108-
109-
# Check if the AAB exists
110-
if [[ -f "$AAB_PATH" ]]; then
111-
# Create a directory within Kokoro's artifact collection area
112-
ARTIFACT_DEST_DIR="${KOKORO_ARTIFACTS_DIR}/artifacts"
113-
mkdir -p "${ARTIFACT_DEST_DIR}"
114-
115-
# Copy the AAB
116-
cp "${AAB_PATH}" "${ARTIFACT_DEST_DIR}/app-release-unsigned.aab"
117-
echo "SUCCESS: AAB copied to ${ARTIFACT_DEST_DIR}"
118-
119-
# Find and list the files before copying
120-
# Store the find results in a variable to avoid running find twice
121-
# and to handle the case where no files are found gracefully.
122-
intoto_files=$(find . -type f -name "*.intoto.jsonl")
123-
124-
if [ -n "$intoto_files" ]; then
125-
echo "INFO: Found the following .intoto.jsonl files:"
126-
echo "$intoto_files" # This will list each file on a new line
127-
echo "INFO: Copying .intoto.jsonl files to ${ARTIFACT_DEST_DIR}/"
128-
# Use print0 and xargs -0 for safe handling of filenames with spaces or special characters
129-
find . -type f -name "*.intoto.jsonl" -print0 | xargs -0 -I {} cp {} "${ARTIFACT_DEST_DIR}/"
105+
# This function collects a specific AAB and its associated in-toto files.
106+
# Arguments:
107+
# $1: Source directory for the AAB (e.g., "app/build/outputs/bundle/release")
108+
# $2: Source filename for the AAB (e.g., "app-release.aab")
109+
# $3: Destination filename for the AAB (e.g., "app-release-unsigned.aab")
110+
collect_artifacts() {
111+
local aab_src_dir="$1"
112+
local aab_file="$2"
113+
local aab_dest_file="$3"
114+
local aab_path="${aab_src_dir}/${aab_file}"
115+
116+
# Check if the AAB exists
117+
if [[ -f "$aab_path" ]]; then
118+
# Create a directory within Kokoro's artifact collection area
119+
local artifact_dest_dir="${KOKORO_ARTIFACTS_DIR}/artifacts"
120+
mkdir -p "${artifact_dest_dir}"
121+
122+
# Copy the AAB
123+
cp "${aab_path}" "${artifact_dest_dir}/${aab_dest_file}"
124+
echo "SUCCESS: AAB copied to ${artifact_dest_dir}"
125+
126+
# Find and list the files before copying
127+
# Store the find results in a variable to avoid running find twice
128+
# and to handle the case where no files are found gracefully.
129+
local intoto_files
130+
intoto_files=$(find . -type f -name "*.intoto.jsonl")
131+
132+
if [ -n "$intoto_files" ]; then
133+
echo "INFO: Found the following .intoto.jsonl files:"
134+
echo "$intoto_files" # This will list each file on a new line
135+
echo "INFO: Copying .intoto.jsonl files to ${artifact_dest_dir}/"
136+
# Use print0 and xargs -0 for safe handling of filenames with spaces or special characters
137+
find . -type f -name "*.intoto.jsonl" -print0 | xargs -0 -I {} cp {} "${artifact_dest_dir}/"
138+
else
139+
echo "INFO: No .intoto.jsonl files found."
140+
fi
130141
else
131-
echo "INFO: No .intoto.jsonl files found."
142+
echo "FAILURE: AAB not found at ${aab_path}"
143+
exit 1
132144
fi
145+
}
146+
147+
# Collect the main application artifacts
148+
collect_artifacts "app/build/outputs/bundle/release" "app-release.aab" "app-release-unsigned.aab"
149+
150+
# Copy the app-specific SPDX SBOM
151+
echo "INFO: Copying SPDX SBOM..."
152+
cp app/build/spdx/release.spdx.json "${KOKORO_ARTIFACTS_DIR}/artifacts/app-release.spdx.json"
133153

134-
echo "INFO: Copying SPDX SBOM..."
135-
# The output file from app:spdxSbomForRelease is build/spdx/release.spdx.json
136-
cp app/build/spdx/release.spdx.json "${KOKORO_ARTIFACTS_DIR}/artifacts/app-release.spdx.json"
154+
# Collect the Wear OS application artifacts
155+
collect_artifacts "wear/build/outputs/bundle/release" "wear-release.aab" "wear-release-unsigned.aab"
137156

138-
else
139-
echo "FAILURE: AAB not found at ${AAB_PATH}"
140-
exit 1
141-
fi
157+
exit 0

build_presubmit.sh

Lines changed: 53 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -94,51 +94,66 @@ chmod +x ./gradlew
9494
echo "INFO: Cleaning the project..."
9595
./gradlew clean -Pandroid.sdk.path=$ANDROID_HOME
9696

97-
# Build the production release bundle without generating a baseline profile.
98-
echo "INFO: Building the production release bundle..."
97+
# Build the production release bundles without generating baseline profiles.
98+
echo "INFO: Building the Android production release bundle..."
9999
./gradlew app:bundleRelease app:spdxSbomForRelease -x test -x uploadCrashlyticsMappingFileRelease -Pandroid.sdk.path=$ANDROID_HOME -PCI_BUILD=true
100100

101+
echo "INFO: Building the Wear OS production release bundle..."
102+
./gradlew wear:bundleRelease -x test -x uploadCrashlyticsMappingFileRelease -Pandroid.sdk.path=$ANDROID_HOME -PCI_BUILD=true
103+
101104
# --- Artifact Collection ---
102105
echo "INFO: Preparing artifacts for Kokoro..."
103106

104-
# Default output path for the bundle
105-
AAB_SRC_DIR="app/build/outputs/bundle/release"
106-
# The default name of the AAB for a release bundle
107-
AAB_FILE="app-release.aab"
108-
AAB_PATH="${AAB_SRC_DIR}/${AAB_FILE}"
109-
110-
# Check if the AAB exists
111-
if [[ -f "$AAB_PATH" ]]; then
112-
# Create a directory within Kokoro's artifact collection area
113-
ARTIFACT_DEST_DIR="${KOKORO_ARTIFACTS_DIR}/artifacts"
114-
mkdir -p "${ARTIFACT_DEST_DIR}"
115-
116-
# Copy the AAB
117-
cp "${AAB_PATH}" "${ARTIFACT_DEST_DIR}/app-release-unsigned.aab"
118-
echo "SUCCESS: AAB copied to ${ARTIFACT_DEST_DIR}"
119-
120-
# Find and list the files before copying
121-
# Store the find results in a variable to avoid running find twice
122-
# and to handle the case where no files are found gracefully.
123-
intoto_files=$(find . -type f -name "*.intoto.jsonl")
124-
125-
if [ -n "$intoto_files" ]; then
126-
echo "INFO: Found the following .intoto.jsonl files:"
127-
echo "$intoto_files" # This will list each file on a new line
128-
echo "INFO: Copying .intoto.jsonl files to ${ARTIFACT_DEST_DIR}/"
129-
# Use print0 and xargs -0 for safe handling of filenames with spaces or special characters
130-
find . -type f -name "*.intoto.jsonl" -print0 | xargs -0 -I {} cp {} "${ARTIFACT_DEST_DIR}/"
107+
# This function collects a specific AAB and its associated in-toto files.
108+
# Arguments:
109+
# $1: Source directory for the AAB (e.g., "app/build/outputs/bundle/release")
110+
# $2: Source filename for the AAB (e.g., "app-release.aab")
111+
# $3: Destination filename for the AAB (e.g., "app-release-unsigned.aab")
112+
collect_artifacts() {
113+
local aab_src_dir="$1"
114+
local aab_file="$2"
115+
local aab_dest_file="$3"
116+
local aab_path="${aab_src_dir}/${aab_file}"
117+
118+
# Check if the AAB exists
119+
if [[ -f "$aab_path" ]]; then
120+
# Create a directory within Kokoro's artifact collection area
121+
local artifact_dest_dir="${KOKORO_ARTIFACTS_DIR}/artifacts"
122+
mkdir -p "${artifact_dest_dir}"
123+
124+
# Copy the AAB
125+
cp "${aab_path}" "${artifact_dest_dir}/${aab_dest_file}"
126+
echo "SUCCESS: AAB copied to ${artifact_dest_dir}"
127+
128+
# Find and list the files before copying
129+
# Store the find results in a variable to avoid running find twice
130+
# and to handle the case where no files are found gracefully.
131+
local intoto_files
132+
intoto_files=$(find . -type f -name "*.intoto.jsonl")
133+
134+
if [ -n "$intoto_files" ]; then
135+
echo "INFO: Found the following .intoto.jsonl files:"
136+
echo "$intoto_files" # This will list each file on a new line
137+
echo "INFO: Copying .intoto.jsonl files to ${artifact_dest_dir}/"
138+
# Use print0 and xargs -0 for safe handling of filenames with spaces or special characters
139+
find . -type f -name "*.intoto.jsonl" -print0 | xargs -0 -I {} cp {} "${artifact_dest_dir}/"
140+
else
141+
echo "INFO: No .intoto.jsonl files found."
142+
fi
131143
else
132-
echo "INFO: No .intoto.jsonl files found."
144+
echo "FAILURE: AAB not found at ${aab_path}"
145+
exit 1
133146
fi
147+
}
148+
149+
# Collect the main application artifacts
150+
collect_artifacts "app/build/outputs/bundle/release" "app-release.aab" "app-release-unsigned.aab"
134151

135-
echo "INFO: Copying SPDX SBOM..."
136-
# The output file from app:spdxSbomForRelease is build/spdx/release.spdx.json
137-
cp app/build/spdx/release.spdx.json "${KOKORO_ARTIFACTS_DIR}/artifacts/app-release.spdx.json"
152+
# Copy the app-specific SPDX SBOM
153+
echo "INFO: Copying SPDX SBOM..."
154+
cp app/build/spdx/release.spdx.json "${KOKORO_ARTIFACTS_DIR}/artifacts/app-release.spdx.json"
138155

139-
else
140-
echo "FAILURE: AAB not found at ${AAB_PATH}"
141-
exit 1
142-
fi
156+
# Collect the Wear OS application artifacts
157+
collect_artifacts "wear/build/outputs/bundle/release" "wear-release.aab" "wear-release-unsigned.aab"
143158

144-
exit 0
159+
exit 0

core/network/src/main/java/com/android/developers/androidify/RemoteConfigDataSource.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ interface RemoteConfigDataSource {
4545
fun getBotBackgroundInstructionPrompt(): String
4646

4747
fun watchfaceFeatureEnabled(): Boolean
48+
49+
fun isXrEnabled(): Boolean
4850
}
4951

5052
@Singleton
@@ -117,4 +119,8 @@ class RemoteConfigDataSourceImpl @Inject constructor() : RemoteConfigDataSource
117119
override fun watchfaceFeatureEnabled(): Boolean {
118120
return remoteConfig.getBoolean("watchface_feature_enabled")
119121
}
122+
123+
override fun isXrEnabled(): Boolean {
124+
return remoteConfig.getBoolean("xr_feature_enabled")
125+
}
120126
}

core/network/src/main/res/xml/remote_config_defaults.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
<key>background_vibes_feature_enabled</key>
2424
<value>false</value>
2525
</entry>
26+
<entry>
27+
<key>xr_feature_enabled</key>
28+
<value>false</value>
29+
</entry>
2630
<entry>
2731
<key>bot_background_instruction_prompt</key>
2832
<value>Add the input image android bot as the main subject to the result,

core/testing/src/main/java/com/android/developers/testing/network/TestRemoteConfigDataSource.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,8 @@ class TestRemoteConfigDataSource(private val useGeminiNano: Boolean) : RemoteCon
8383
override fun watchfaceFeatureEnabled(): Boolean {
8484
return true
8585
}
86+
87+
override fun isXrEnabled(): Boolean {
88+
return false
89+
}
8690
}

core/theme/src/main/java/com/android/developers/androidify/theme/components/Backgrounds.kt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ import androidx.compose.ui.graphics.vector.ImageVector
3636
import androidx.compose.ui.graphics.vector.rememberVectorPainter
3737
import androidx.compose.ui.layout.ContentScale
3838
import androidx.compose.ui.res.vectorResource
39+
import androidx.compose.ui.tooling.preview.Devices.PIXEL_TABLET
40+
import androidx.compose.ui.tooling.preview.Preview
3941
import androidx.compose.ui.unit.IntOffset
4042
import androidx.compose.ui.unit.dp
4143
import com.android.developers.androidify.theme.AndroidifyTheme
@@ -78,6 +80,31 @@ fun SquiggleBackground(
7880
}
7981
}
8082

83+
/**
84+
* Background squiggle that tries to fit in its parent.
85+
*/
86+
@Composable
87+
fun SquiggleBackgroundFull() {
88+
val vectorBackground =
89+
rememberVectorPainter(ImageVector.vectorResource(R.drawable.squiggle_full))
90+
Box(modifier = Modifier.fillMaxSize()) {
91+
Image(
92+
painter = vectorBackground,
93+
contentDescription = null,
94+
modifier = Modifier.fillMaxSize(),
95+
contentScale = ContentScale.Fit,
96+
)
97+
}
98+
}
99+
100+
@Preview(device = PIXEL_TABLET)
101+
@Composable
102+
fun SquiggleFullImagePreview() {
103+
AndroidifyTheme {
104+
SquiggleBackgroundFull()
105+
}
106+
}
107+
81108
@LargeScreensPreview
82109
@Composable
83110
private fun SquiggleBackgroundLargePreview() {

0 commit comments

Comments
 (0)