Skip to content

Commit 4d1f5ea

Browse files
committed
Merge remote-tracking branch 'origin/main' into emb/fcm-v1-reg
2 parents 11ac6ee + 217bd35 commit 4d1f5ea

21 files changed

Lines changed: 2151 additions & 210 deletions

File tree

ai-logic/firebase-ai/src/androidTest/kotlin/com/google/firebase/ai/AIModels.kt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ class AIModels {
2828
var app: FirebaseApp? = null
2929
lateinit var vertexAIFlashModel: GenerativeModel
3030
lateinit var vertexAIFlashLiteModel: GenerativeModel
31+
lateinit var vertexAI3_5FlashModel: GenerativeModel
3132
lateinit var googleAIFlashModel: GenerativeModel
3233
lateinit var googleAIFlashLiteModel: GenerativeModel
34+
lateinit var googleAI3_5FlashModel: GenerativeModel
3335
lateinit var vertexAITemplateModel: TemplateGenerativeModel
3436
lateinit var googleAITemplateModel: TemplateGenerativeModel
3537

@@ -41,8 +43,10 @@ class AIModels {
4143
return listOf(
4244
vertexAIFlashModel,
4345
vertexAIFlashLiteModel,
46+
vertexAI3_5FlashModel,
4447
googleAIFlashModel,
45-
googleAIFlashLiteModel
48+
googleAIFlashLiteModel,
49+
googleAI3_5FlashModel,
4650
)
4751
}
4852

@@ -66,6 +70,11 @@ class AIModels {
6670
.generativeModel(
6771
modelName = "gemini-2.5-flash-lite",
6872
)
73+
vertexAI3_5FlashModel =
74+
FirebaseAI.getInstance(app!!, GenerativeBackend.vertexAI("global"))
75+
.generativeModel(
76+
modelName = "gemini-3.5-flash",
77+
)
6978
googleAIFlashModel =
7079
FirebaseAI.getInstance(app!!, GenerativeBackend.googleAI())
7180
.generativeModel(
@@ -76,6 +85,11 @@ class AIModels {
7685
.generativeModel(
7786
modelName = "gemini-2.5-flash-lite",
7887
)
88+
googleAI3_5FlashModel =
89+
FirebaseAI.getInstance(app!!, GenerativeBackend.googleAI())
90+
.generativeModel(
91+
modelName = "gemini-3.5-flash",
92+
)
7993
vertexAITemplateModel =
8094
FirebaseAI.getInstance(app!!, GenerativeBackend.vertexAI()).templateGenerativeModel()
8195
googleAITemplateModel =

firebase-dataconnect/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
as the random numbers were not used in a security-sensitive context,
1010
thus the performance costs of secure random number generation were unnecessary.
1111
([#8154](https://github.com/firebase/firebase-android-sdk/pull/8154))
12+
- [fixed] Queries executed with FetchPolicy.CACHE_ONLY now fail, as expected,
13+
if local caching is not enabled, instead of behaving like SERVER_ONLY.
14+
([#8214](https://github.com/firebase/firebase-android-sdk/pull/8214))
1215

1316
# 17.2.2
1417

firebase-dataconnect/scripts/headless_android_emulator_run.zsh

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ show_help() {
2323
say "This can be useful for running instrumentation tests"
2424
say "without the overhead of rendering the Android UI."
2525
say
26-
say "Syntax: $0 [avd]"
26+
say "Syntax: $0 [avd] [-- emulator_flags...]"
2727
say
2828
say "The AVD to use may be specified as the first argument,"
2929
say "and _must_ be specified if there is more than one AVD"
3030
say "configured in the Android emulator."
3131
say
32+
say "Any arguments after '--' are passed directly to the emulator command."
33+
say
3234
say "The ANDROID_HOME environment variable must be set and is used"
3335
say "to find the Android emulator binary."
3436
}
@@ -39,10 +41,22 @@ if (( ${#opt_help} )); then
3941
show_help
4042
exit 0
4143
fi
42-
if (( # == 1 )); then
43-
typeset -r emulator_avd="$1"
44-
elif (( # > 1 )); then
45-
say_error "unexpected command-line argument: $2" >&2
44+
45+
typeset -i double_dash_index=${@[(i)--]}
46+
typeset -a script_args
47+
typeset -a emulator_extra_args
48+
if (( double_dash_index <= $# )); then
49+
script_args=( "${@[1,double_dash_index-1]}" )
50+
emulator_extra_args=( "${@[double_dash_index+1,$#]}" )
51+
else
52+
script_args=( "$@" )
53+
emulator_extra_args=( )
54+
fi
55+
56+
if (( ${#script_args} == 1 )); then
57+
typeset -r emulator_avd="${script_args[1]}"
58+
elif (( ${#script_args} > 1 )); then
59+
say_error "unexpected command-line argument: ${script_args[2]}" >&2
4660
sayp "Run with %F{cyan}-h%f for help." >&2
4761
exit 2
4862
fi
@@ -98,6 +112,7 @@ typeset -r args=(
98112
-timezone UTC
99113
-skip-adb-auth
100114
-no-metrics
115+
"${emulator_extra_args[@]}"
101116
)
102117

103118
say_args "${args[@]}"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.firebase.dataconnect.core
18+
19+
import com.google.firebase.dataconnect.core.LoggerGlobals.Logger
20+
import com.google.firebase.dataconnect.core.LoggerGlobals.debug
21+
import com.google.firebase.dataconnect.sqlite.DataConnectCacheDatabase
22+
import com.google.firebase.dataconnect.util.ObjectLifecycleManager
23+
import java.io.File
24+
import kotlinx.coroutines.CoroutineDispatcher
25+
26+
internal class DataConnectCache(
27+
private val dbFile: File?,
28+
val maxAge: kotlin.time.Duration,
29+
private val cpuDispatcher: CoroutineDispatcher,
30+
private val logger: Logger,
31+
) : ObjectLifecycleManager<DataConnectCacheDatabase>(cpuDispatcher, logger) {
32+
33+
val maxAgeProto: com.google.protobuf.Duration =
34+
maxAge.toComponents { seconds, nanos ->
35+
com.google.protobuf.Duration.newBuilder().setSeconds(seconds).setNanos(nanos).build()
36+
}
37+
38+
override fun create() =
39+
DataConnectCacheDatabase(
40+
dbFile,
41+
cpuDispatcher,
42+
Logger("DataConnectCacheDatabase").apply { debug { "created by ${logger.nameWithId}" } }
43+
)
44+
45+
override suspend fun initialize(instance: DataConnectCacheDatabase) {
46+
instance.initialize()
47+
}
48+
49+
override suspend fun destroy(instance: DataConnectCacheDatabase) {
50+
instance.close()
51+
}
52+
53+
override fun toString() = "DataConnectCache(dbFile=$dbFile, maxAge=$maxAge)"
54+
}

0 commit comments

Comments
 (0)