Skip to content

Commit 253b2c0

Browse files
authored
Merge f042932 into ac26746
2 parents ac26746 + f042932 commit 253b2c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+15602
-618
lines changed

firebase-firestore/api.txt

Lines changed: 76 additions & 74 deletions
Large diffs are not rendered by default.

firebase-firestore/firebase-firestore.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ dependencies {
142142
implementation libs.grpc.stub
143143
implementation libs.kotlin.stdlib
144144
implementation libs.kotlinx.coroutines.core
145+
implementation 'com.google.re2j:re2j:1.6'
145146

146147
compileOnly libs.autovalue.annotations
147148
compileOnly libs.javax.annotation.jsr250

firebase-firestore/src/main/java/com/google/firebase/firestore/DocumentReference.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public final class DocumentReference {
7171
}
7272

7373
/** @hide */
74-
static DocumentReference forPath(ResourcePath path, FirebaseFirestore firestore) {
74+
public static DocumentReference forPath(ResourcePath path, FirebaseFirestore firestore) {
7575
if (path.length() % 2 != 0) {
7676
throw new IllegalArgumentException(
7777
"Invalid document reference. Document references must have an even number "

firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,4 +894,15 @@ public PipelineSource pipeline() {
894894
clientProvider.ensureConfigured();
895895
return new PipelineSource(this);
896896
}
897+
898+
/**
899+
* Build a new RealtimePipeline
900+
*
901+
* @return {@code RealtimePipelineSource} for this Firestore instance.
902+
*/
903+
@NonNull
904+
public RealtimePipelineSource realtimePipeline() {
905+
clientProvider.ensureConfigured();
906+
return new RealtimePipelineSource(this);
907+
}
897908
}

firebase-firestore/src/main/java/com/google/firebase/firestore/ListenerRegistration.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
package com.google.firebase.firestore;
1616

17+
import android.app.Activity;
18+
import androidx.annotation.NonNull;
19+
import com.google.firebase.firestore.core.ActivityScope;
20+
1721
/** Represents a listener that can be removed by calling {@link #remove()}. */
1822
public interface ListenerRegistration {
1923

@@ -22,4 +26,13 @@ public interface ListenerRegistration {
2226
* call, subsequent calls have no effect.
2327
*/
2428
void remove();
29+
30+
/**
31+
* The listener will be automatically removed during {@link Activity#onStop}.
32+
*
33+
* @param activity The activity to scope the listener to.
34+
*/
35+
default void scope(@NonNull Activity activity) {
36+
ActivityScope.bind(activity, this);
37+
}
2538
}

0 commit comments

Comments
 (0)