Skip to content

Commit 77b0dc7

Browse files
committed
Merge branch 'fis_sdk' of github.com:firebase/firebase-android-sdk into fis_sdk
2 parents f866315 + 56d72ee commit 77b0dc7

36 files changed

+3703
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Signature format: 2.0
2+
package com.google.firebase.installations {
3+
4+
public abstract class InstallationTokenResult {
5+
ctor public InstallationTokenResult();
6+
method @NonNull public static com.google.firebase.installations.InstallationTokenResult.Builder builder();
7+
method @NonNull public abstract String getToken();
8+
method @NonNull public abstract long getTokenCreationTimestamp();
9+
method @NonNull public abstract long getTokenExpirationTimestamp();
10+
method @NonNull public abstract com.google.firebase.installations.InstallationTokenResult.Builder toBuilder();
11+
}
12+
13+
public abstract static class InstallationTokenResult.Builder {
14+
ctor public InstallationTokenResult.Builder();
15+
method @NonNull public abstract com.google.firebase.installations.InstallationTokenResult build();
16+
method @NonNull public abstract com.google.firebase.installations.InstallationTokenResult.Builder setToken(@NonNull String);
17+
method @NonNull public abstract com.google.firebase.installations.InstallationTokenResult.Builder setTokenCreationTimestamp(long);
18+
method @NonNull public abstract com.google.firebase.installations.InstallationTokenResult.Builder setTokenExpirationTimestamp(long);
19+
}
20+
21+
}
22+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright 2018 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+
16+
plugins {
17+
id 'firebase-library'
18+
}
19+
20+
firebaseLibrary.publishJavadoc = false
21+
22+
android {
23+
compileSdkVersion project.targetSdkVersion
24+
defaultConfig {
25+
minSdkVersion project.minSdkVersion
26+
targetSdkVersion project.targetSdkVersion
27+
versionName version
28+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
29+
}
30+
compileOptions {
31+
sourceCompatibility JavaVersion.VERSION_1_8
32+
targetCompatibility JavaVersion.VERSION_1_8
33+
}
34+
testOptions {
35+
unitTests {
36+
includeAndroidResources = true
37+
}
38+
}
39+
}
40+
41+
dependencies {
42+
implementation 'com.google.android.gms:play-services-tasks:17.0.0'
43+
44+
compileOnly "com.google.auto.value:auto-value-annotations:1.6.5"
45+
annotationProcessor "com.google.auto.value:auto-value:1.6.2"
46+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version=17.1.1
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright 2019 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+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
17+
package="com.google.firebase.installations.interop" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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 static java.lang.annotation.RetentionPolicy.SOURCE;
18+
19+
import androidx.annotation.IntDef;
20+
import com.google.android.gms.tasks.Task;
21+
import java.lang.annotation.Retention;
22+
23+
/**
24+
* This is an interface of {@code FirebaseInstallations} that is only exposed to 2p via component
25+
* injection.
26+
*
27+
* @hide
28+
*/
29+
public interface FirebaseInstallationsApi {
30+
31+
/** Specifies the options to get a FIS AuthToken. */
32+
@IntDef({DO_NOT_FORCE_REFRESH, FORCE_REFRESH})
33+
@Retention(SOURCE)
34+
@interface AuthTokenOption {}
35+
/**
36+
* AuthToken is not refreshed until requested by the developer or if one doesn't exist, is expired
37+
* or about to expire.
38+
*/
39+
int DO_NOT_FORCE_REFRESH = 0;
40+
/**
41+
* AuthToken is forcefully refreshed on calling the {@link
42+
* FirebaseInstallationsApi#getToken(int)}.
43+
*/
44+
int FORCE_REFRESH = 1;
45+
46+
/**
47+
* Async function that returns a globally unique identifier of this Firebase app installation.
48+
* This is a url-safe base64 string of a 128-bit integer.
49+
*/
50+
Task<String> getId();
51+
52+
/** Async function that returns a auth token(public key) of this Firebase app installation. */
53+
Task<InstallationTokenResult> getToken(@AuthTokenOption int authTokenOption);
54+
55+
/**
56+
* Async function that deletes this Firebase app installation from Firebase backend. This call
57+
* would possibly lead Firebase Notification, Firebase RemoteConfig, Firebase Predictions or
58+
* Firebase In-App Messaging not function properly.
59+
*/
60+
Task<Void> delete();
61+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
import com.google.auto.value.AutoValue;
19+
20+
/** This class represents a set of values describing a FIS Auth Token Result. */
21+
@AutoValue
22+
public abstract class InstallationTokenResult {
23+
24+
/** A new FIS Auth-Token, created for this Firebase Installation. */
25+
@NonNull
26+
public abstract String getToken();
27+
/**
28+
* The amount of time, in seconds, before the auth-token expires for this Firebase Installation.
29+
*/
30+
@NonNull
31+
public abstract long getTokenExpirationTimestamp();
32+
33+
/**
34+
* The amount of time, in seconds, when the auth-token was created for this Firebase Installation.
35+
*/
36+
@NonNull
37+
public abstract long getTokenCreationTimestamp();
38+
39+
@NonNull
40+
public abstract Builder toBuilder();
41+
42+
/** Returns a default Builder object to create an InstallationResponse object */
43+
@NonNull
44+
public static InstallationTokenResult.Builder builder() {
45+
return new AutoValue_InstallationTokenResult.Builder();
46+
}
47+
48+
@AutoValue.Builder
49+
public abstract static class Builder {
50+
@NonNull
51+
public abstract Builder setToken(@NonNull String value);
52+
53+
@NonNull
54+
public abstract Builder setTokenExpirationTimestamp(long value);
55+
56+
@NonNull
57+
public abstract Builder setTokenCreationTimestamp(long value);
58+
59+
@NonNull
60+
public abstract InstallationTokenResult build();
61+
}
62+
}

firebase-installations/api.txt

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
// Signature format: 2.0
2+
package com.google.firebase.installations {
3+
4+
public class FirebaseInstallations {
5+
method @NonNull public Task<Void> delete();
6+
method @NonNull public Task<String> getId();
7+
method @NonNull public static com.google.firebase.installations.FirebaseInstallations getInstance();
8+
method @NonNull public static com.google.firebase.installations.FirebaseInstallations getInstance(@NonNull FirebaseApp);
9+
method @NonNull public Task<InstallationTokenResult> getToken(int);
10+
}
11+
12+
public class FirebaseInstallationsException {
13+
ctor public FirebaseInstallationsException(@NonNull com.google.firebase.installations.FirebaseInstallationsException.Status);
14+
ctor public FirebaseInstallationsException(@NonNull String, @NonNull com.google.firebase.installations.FirebaseInstallationsException.Status);
15+
ctor public FirebaseInstallationsException(@NonNull String, @NonNull com.google.firebase.installations.FirebaseInstallationsException.Status, @NonNull Throwable);
16+
method @NonNull public com.google.firebase.installations.FirebaseInstallationsException.Status getStatus();
17+
}
18+
19+
public enum FirebaseInstallationsException.Status {
20+
enum_constant public static final com.google.firebase.installations.FirebaseInstallationsException.Status BAD_CONFIG;
21+
}
22+
23+
public class RandomFidGenerator {
24+
ctor public RandomFidGenerator();
25+
method @NonNull public String createRandomFid();
26+
}
27+
28+
}
29+
30+
package com.google.firebase.installations.local {
31+
32+
public class IidStore {
33+
ctor public IidStore();
34+
method @Nullable public String readIid();
35+
}
36+
37+
public class PersistedInstallation {
38+
ctor public PersistedInstallation(@NonNull FirebaseApp);
39+
method public void clearForTesting();
40+
method @NonNull public com.google.firebase.installations.local.PersistedInstallationEntry insertOrUpdatePersistedInstallationEntry(@NonNull com.google.firebase.installations.local.PersistedInstallationEntry);
41+
method @NonNull public com.google.firebase.installations.local.PersistedInstallationEntry readPersistedInstallationEntryValue();
42+
}
43+
44+
public enum PersistedInstallation.RegistrationStatus {
45+
enum_constant public static final com.google.firebase.installations.local.PersistedInstallation.RegistrationStatus ATTEMPT_MIGRATION;
46+
enum_constant public static final com.google.firebase.installations.local.PersistedInstallation.RegistrationStatus NOT_GENERATED;
47+
enum_constant public static final com.google.firebase.installations.local.PersistedInstallation.RegistrationStatus REGISTERED;
48+
enum_constant public static final com.google.firebase.installations.local.PersistedInstallation.RegistrationStatus REGISTER_ERROR;
49+
enum_constant public static final com.google.firebase.installations.local.PersistedInstallation.RegistrationStatus UNREGISTERED;
50+
}
51+
52+
public abstract class PersistedInstallationEntry {
53+
ctor public PersistedInstallationEntry();
54+
method @NonNull public static com.google.firebase.installations.local.PersistedInstallationEntry.Builder builder();
55+
method @Nullable public abstract String getAuthToken();
56+
method public abstract long getExpiresInSecs();
57+
method @Nullable public abstract String getFirebaseInstallationId();
58+
method @Nullable public abstract String getFisError();
59+
method @Nullable public abstract String getRefreshToken();
60+
method @NonNull public abstract com.google.firebase.installations.local.PersistedInstallation.RegistrationStatus getRegistrationStatus();
61+
method public abstract long getTokenCreationEpochInSecs();
62+
method public boolean isErrored();
63+
method public boolean isNotGenerated();
64+
method public boolean isRegistered();
65+
method public boolean isUnregistered();
66+
method public boolean shouldAttemptMigration();
67+
method @NonNull public abstract com.google.firebase.installations.local.PersistedInstallationEntry.Builder toBuilder();
68+
method @NonNull public com.google.firebase.installations.local.PersistedInstallationEntry withAuthToken(@NonNull String, long, long);
69+
method @NonNull public com.google.firebase.installations.local.PersistedInstallationEntry withClearedAuthToken();
70+
method @NonNull public com.google.firebase.installations.local.PersistedInstallationEntry withFisError(@NonNull String);
71+
method @NonNull public com.google.firebase.installations.local.PersistedInstallationEntry withNoGeneratedFid();
72+
method @NonNull public com.google.firebase.installations.local.PersistedInstallationEntry withRegisteredFid(@NonNull String, @NonNull String, long, @Nullable String, long);
73+
method @NonNull public com.google.firebase.installations.local.PersistedInstallationEntry withUnregisteredFid(@NonNull String);
74+
field @NonNull public static com.google.firebase.installations.local.PersistedInstallationEntry INSTANCE;
75+
}
76+
77+
public abstract static class PersistedInstallationEntry.Builder {
78+
ctor public PersistedInstallationEntry.Builder();
79+
method @NonNull public abstract com.google.firebase.installations.local.PersistedInstallationEntry build();
80+
method @NonNull public abstract com.google.firebase.installations.local.PersistedInstallationEntry.Builder setAuthToken(@Nullable String);
81+
method @NonNull public abstract com.google.firebase.installations.local.PersistedInstallationEntry.Builder setExpiresInSecs(long);
82+
method @NonNull public abstract com.google.firebase.installations.local.PersistedInstallationEntry.Builder setFirebaseInstallationId(@NonNull String);
83+
method @NonNull public abstract com.google.firebase.installations.local.PersistedInstallationEntry.Builder setFisError(@Nullable String);
84+
method @NonNull public abstract com.google.firebase.installations.local.PersistedInstallationEntry.Builder setRefreshToken(@Nullable String);
85+
method @NonNull public abstract com.google.firebase.installations.local.PersistedInstallationEntry.Builder setRegistrationStatus(@NonNull com.google.firebase.installations.local.PersistedInstallation.RegistrationStatus);
86+
method @NonNull public abstract com.google.firebase.installations.local.PersistedInstallationEntry.Builder setTokenCreationEpochInSecs(long);
87+
}
88+
89+
}
90+
91+
package com.google.firebase.installations.remote {
92+
93+
public class FirebaseInstallationServiceClient {
94+
ctor public FirebaseInstallationServiceClient(@NonNull Context, @Nullable UserAgentPublisher, @Nullable HeartBeatInfo);
95+
method @NonNull public com.google.firebase.installations.remote.InstallationResponse createFirebaseInstallation(@NonNull String, @NonNull String, @NonNull String, @NonNull String);
96+
method @NonNull public void deleteFirebaseInstallation(@NonNull String, @NonNull String, @NonNull String, @NonNull String);
97+
method @NonNull public com.google.firebase.installations.remote.TokenResult generateAuthToken(@NonNull String, @NonNull String, @NonNull String, @NonNull String);
98+
}
99+
100+
public abstract class InstallationResponse {
101+
ctor public InstallationResponse();
102+
method @NonNull public static com.google.firebase.installations.remote.InstallationResponse.Builder builder();
103+
method @Nullable public abstract com.google.firebase.installations.remote.TokenResult getAuthToken();
104+
method @Nullable public abstract String getFid();
105+
method @Nullable public abstract String getRefreshToken();
106+
method @Nullable public abstract com.google.firebase.installations.remote.InstallationResponse.ResponseCode getResponseCode();
107+
method @Nullable public abstract String getUri();
108+
method @NonNull public abstract com.google.firebase.installations.remote.InstallationResponse.Builder toBuilder();
109+
}
110+
111+
public abstract static class InstallationResponse.Builder {
112+
ctor public InstallationResponse.Builder();
113+
method @NonNull public abstract com.google.firebase.installations.remote.InstallationResponse build();
114+
method @NonNull public abstract com.google.firebase.installations.remote.InstallationResponse.Builder setAuthToken(@NonNull com.google.firebase.installations.remote.TokenResult);
115+
method @NonNull public abstract com.google.firebase.installations.remote.InstallationResponse.Builder setFid(@NonNull String);
116+
method @NonNull public abstract com.google.firebase.installations.remote.InstallationResponse.Builder setRefreshToken(@NonNull String);
117+
method @NonNull public abstract com.google.firebase.installations.remote.InstallationResponse.Builder setResponseCode(@NonNull com.google.firebase.installations.remote.InstallationResponse.ResponseCode);
118+
method @NonNull public abstract com.google.firebase.installations.remote.InstallationResponse.Builder setUri(@NonNull String);
119+
}
120+
121+
public enum InstallationResponse.ResponseCode {
122+
enum_constant public static final com.google.firebase.installations.remote.InstallationResponse.ResponseCode BAD_CONFIG;
123+
enum_constant public static final com.google.firebase.installations.remote.InstallationResponse.ResponseCode OK;
124+
}
125+
126+
public abstract class TokenResult {
127+
ctor public TokenResult();
128+
method @NonNull public static com.google.firebase.installations.remote.TokenResult.Builder builder();
129+
method @Nullable public abstract com.google.firebase.installations.remote.TokenResult.ResponseCode getResponseCode();
130+
method @Nullable public abstract String getToken();
131+
method @NonNull public abstract long getTokenExpirationTimestamp();
132+
method @NonNull public abstract com.google.firebase.installations.remote.TokenResult.Builder toBuilder();
133+
}
134+
135+
public abstract static class TokenResult.Builder {
136+
ctor public TokenResult.Builder();
137+
method @NonNull public abstract com.google.firebase.installations.remote.TokenResult build();
138+
method @NonNull public abstract com.google.firebase.installations.remote.TokenResult.Builder setResponseCode(@NonNull com.google.firebase.installations.remote.TokenResult.ResponseCode);
139+
method @NonNull public abstract com.google.firebase.installations.remote.TokenResult.Builder setToken(@NonNull String);
140+
method @NonNull public abstract com.google.firebase.installations.remote.TokenResult.Builder setTokenExpirationTimestamp(long);
141+
}
142+
143+
public enum TokenResult.ResponseCode {
144+
enum_constant public static final com.google.firebase.installations.remote.TokenResult.ResponseCode AUTH_ERROR;
145+
enum_constant public static final com.google.firebase.installations.remote.TokenResult.ResponseCode BAD_CONFIG;
146+
enum_constant public static final com.google.firebase.installations.remote.TokenResult.ResponseCode OK;
147+
}
148+
149+
}
150+

0 commit comments

Comments
 (0)