Skip to content

Commit 095296b

Browse files
committed
Addressing review comments.
1 parent d0ce8fa commit 095296b

File tree

12 files changed

+52
-243
lines changed

12 files changed

+52
-243
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=17.1.1
1+
version=17.1.1

firebase-installations-interop/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
<!-- limitations under the License. -->
1515

1616
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
17-
package="com.google.firebase.installations.interop" />
17+
package="com.google.firebase.installations.interop" />

firebase-installations-interop/src/main/java/com/google/firebase/installations/FirebaseInstallationsApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public interface FirebaseInstallationsApi {
3131
Task<String> getId();
3232

3333
/** Async function that returns a auth token(public key) of this Firebase app installation. */
34-
Task<String> getAuthToken();
34+
Task<InstallationTokenResult> getAuthToken(boolean forceRefresh);
3535

3636
/**
3737
* Async function that deletes this Firebase app installation from Firebase backend. This call
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright 2019 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package com.google.firebase.installations;
16+
17+
import androidx.annotation.NonNull;
18+
19+
/** A set of values describing a FIS Auth Token Result. */
20+
public class InstallationTokenResult {
21+
22+
/** A new FIS Auth-Token, created for this firebase installation. */
23+
private final String authToken;
24+
/**
25+
* The amount of time, in milliseconds, before the auth-token expires for this firebase
26+
* installation.
27+
*/
28+
private final long tokenExpirationTimestampMillis;
29+
30+
public InstallationTokenResult(@NonNull String authToken, long tokenExpirationTimestampMillis) {
31+
this.authToken = authToken;
32+
this.tokenExpirationTimestampMillis = tokenExpirationTimestampMillis;
33+
}
34+
35+
@NonNull
36+
public String getAuthToken() {
37+
return authToken;
38+
}
39+
40+
public long getTokenExpirationTimestampMillis() {
41+
return tokenExpirationTimestampMillis;
42+
}
43+
}

firebase-installations/firebase-installations.gradle

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,6 @@
1515

1616
plugins {
1717
id 'firebase-library'
18-
id 'com.google.protobuf'
19-
}
20-
21-
protobuf {
22-
// Configure the protoc executable
23-
protoc {
24-
// Download from repositories
25-
artifact = 'com.google.protobuf:protoc:3.4.0'
26-
}
27-
plugins {
28-
grpc {
29-
artifact = 'io.grpc:protoc-gen-grpc-java:1.21.0'
30-
}
31-
javalite {
32-
// The codegen for lite comes as a separate artifact
33-
artifact = 'com.google.protobuf:protoc-gen-javalite:3.0.0'
34-
}
35-
}
36-
generateProtoTasks {
37-
all().each { task ->
38-
task.builtins {
39-
// In most cases you don't need the full Java output
40-
// if you use the lite output.
41-
remove java
42-
}
43-
task.plugins {
44-
grpc {
45-
option 'lite'
46-
}
47-
javalite {}
48-
}
49-
}
50-
}
5118
}
5219

5320
android {
@@ -59,13 +26,6 @@ android {
5926
versionName version
6027
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
6128
}
62-
sourceSets {
63-
main {
64-
proto {
65-
srcDir 'src/main/proto'
66-
}
67-
}
68-
}
6929
compileOptions {
7030
sourceCompatibility JavaVersion.VERSION_1_8
7131
targetCompatibility JavaVersion.VERSION_1_8
@@ -80,12 +40,8 @@ android {
8040
dependencies {
8141
implementation project(':firebase-common')
8242
implementation project(':firebase-installations-interop')
83-
implementation project(':protolite-well-known-types')
8443

85-
implementation 'io.grpc:grpc-stub:1.21.0'
86-
implementation 'io.grpc:grpc-protobuf-lite:1.21.0'
8744
implementation 'androidx.appcompat:appcompat:1.0.2'
88-
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
8945
implementation 'androidx.multidex:multidex:2.0.1'
9046
implementation 'com.google.android.gms:play-services-tasks:17.0.0'
9147

@@ -94,4 +50,5 @@ dependencies {
9450
testImplementation "org.robolectric:robolectric:$robolectricVersion"
9551

9652
androidTestImplementation 'androidx.test:runner:1.2.0'
53+
implementation 'com.google.guava:guava:16.0.+'
9754
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=17.1.1
1+
version=17.1.1

firebase-installations/lint.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
<!-- Disable the given check in this project -->
1010
<issue id="GradleCompatible" severity="ignore" />
11-
</lint>
11+
</lint>

firebase-installations/proguard-rules.pro

Lines changed: 0 additions & 21 deletions
This file was deleted.

firebase-installations/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
android:value="com.google.firebase.components.ComponentRegistrar" />
1212
</service>
1313
</application>
14-
</manifest>
14+
</manifest>

firebase-installations/src/main/java/com/google/firebase/installations/FirebaseInstallations.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import com.google.android.gms.tasks.Tasks;
2121
import com.google.common.annotations.VisibleForTesting;
2222
import com.google.firebase.FirebaseApp;
23-
import okhttp3.OkHttpClient;
2423

2524
/**
2625
* Entry point for Firebase Installations.
@@ -35,14 +34,11 @@
3534
*/
3635
public class FirebaseInstallations implements FirebaseInstallationsApi {
3736

38-
private final OkHttpClient httpClient;
39-
4037
private final FirebaseApp firebaseApp;
4138

4239
/** package private constructor. */
4340
FirebaseInstallations(FirebaseApp firebaseApp) {
4441
this.firebaseApp = firebaseApp;
45-
httpClient = new OkHttpClient();
4642
}
4743

4844
/**
@@ -81,8 +77,8 @@ public Task<String> getId() {
8177
/** Returns a auth token(public key) of this Firebase app installation. */
8278
@NonNull
8379
@Override
84-
public Task<String> getAuthToken() {
85-
return Tasks.forResult("dummy_auth_token");
80+
public Task<InstallationTokenResult> getAuthToken(boolean forceRefresh) {
81+
return Tasks.forResult(new InstallationTokenResult("dummy_auth_token", 1000l));
8682
}
8783

8884
/**

firebase-installations/src/main/proto/google/firebase/installations/v1/firebase_installations_api.proto

Lines changed: 0 additions & 163 deletions
This file was deleted.

firebase-installations/src/main/res/values/strings.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)