Skip to content

Commit

Permalink
upgrade firebase aars to match android bom 32.7.0 and add new android…
Browse files Browse the repository at this point in the history
… api usage to emulation layer
  • Loading branch information
nbransby committed Jan 4, 2024
1 parent 4b427e1 commit 3810924
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 11 deletions.
20 changes: 10 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ plugins {
`java-library`
`maven-publish`
signing
id("org.jetbrains.kotlin.jvm") version "1.6.10"
kotlin("plugin.serialization") version "1.6.10"
id("org.jetbrains.kotlin.jvm") version "1.7.10"
kotlin("plugin.serialization") version "1.7.10"
id("org.jlleitschuh.gradle.ktlint") version "10.0.0"
id("com.github.ben-manes.versions") version "0.42.0"
}
Expand Down Expand Up @@ -150,20 +150,20 @@ dependencies {
testImplementation("junit:junit:4.13.2")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.6.0")
// firebase aars
aar("com.google.firebase:firebase-firestore:24.1.2")
aar("com.google.firebase:firebase-functions:20.1.0")
aar("com.google.firebase:firebase-database:20.0.5")
aar("com.google.firebase:firebase-config:21.1.0")
aar("com.google.firebase:firebase-firestore:24.10.0")
aar("com.google.firebase:firebase-functions:20.4.0")
aar("com.google.firebase:firebase-database:20.3.0")
aar("com.google.firebase:firebase-config:21.6.0")
aar("com.google.firebase:firebase-installations:17.2.0")
// extracted aar dependencies
api(fileTree(mapOf("dir" to "build/jar", "include" to listOf("*.jar"))))
// polyfill dependencies
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
// firebase dependencies
implementation("com.squareup.okhttp:okhttp:2.7.5")
implementation("com.squareup.okhttp3:okhttp:4.9.3")
// firebase dependencies
implementation("android.arch.lifecycle:common:1.1.1")
implementation("io.grpc:grpc-protobuf-lite:1.52.1")
implementation("io.grpc:grpc-stub:1.52.1")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.2.0
version=0.3.0
4 changes: 4 additions & 0 deletions src/main/java/android/content/ContentProvider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package android.content;

public abstract class ContentProvider {
}
2 changes: 2 additions & 0 deletions src/main/java/android/content/pm/PackageManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public ServiceInfo getServiceInfo(ComponentName component, int flags) throws Nam
data.put("com.google.firebase.components:com.google.firebase.firestore.FirestoreRegistrar", "com.google.firebase.components.ComponentRegistrar");
data.put("com.google.firebase.components:com.google.firebase.auth.FirebaseAuthRegistrar", "com.google.firebase.components.ComponentRegistrar");
data.put("com.google.firebase.components:com.google.firebase.functions.FunctionsRegistrar", "com.google.firebase.components.ComponentRegistrar");
data.put("com.google.firebase.components:com.google.firebase.installations.FirebaseInstallationsRegistrar", "com.google.firebase.components.ComponentRegistrar");
data.put("com.google.firebase.components:com.google.firebase.iid.Registrar", "com.google.firebase.components.ComponentRegistrar");
return new ServiceInfo(data);
}
Expand Down Expand Up @@ -67,6 +68,7 @@ public boolean hasSystemFeature(String name) {
case "android.hardware.type.embedded":
case "android.hardware.type.television":
case "android.hardware.type.automotive":
case "cn.google":
return false;
}
throw new IllegalArgumentException(name);
Expand Down
31 changes: 31 additions & 0 deletions src/main/java/android/os/StrictMode.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package android.os;

public class StrictMode {

public static void setThreadPolicy(ThreadPolicy policy) {

}

public static final class ThreadPolicy {
public static final class Builder {
public Builder detectAll() {
return this;
}
public Builder detectNetwork() {
return this;
}
public Builder detectResourceMismatches() {
return this;
}
public Builder detectUnbufferedIo() {
return this;
}
public Builder penaltyLog() {
return this;
}
public ThreadPolicy build() {
return new ThreadPolicy();
}
}
}
}
12 changes: 12 additions & 0 deletions src/main/java/android/os/SystemClock.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package android.os;

import java.lang.management.ManagementFactory;

public final class SystemClock {
public static long elapsedRealtime() {
return ManagementFactory.getRuntimeMXBean().getUptime();
}
public static long uptimeMillis() {
return ManagementFactory.getRuntimeMXBean().getUptime();
}
}
6 changes: 6 additions & 0 deletions src/main/java/android/os/Trace.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package android.os;

public final class Trace {
public static void beginSection(String sectionName) {}
public static void endSection() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.google.firebase.annotations.concurrent;

public @interface Background {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.google.firebase.annotations.concurrent;

public @interface Blocking {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.google.firebase.annotations.concurrent;

public @interface Lightweight {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.google.firebase.annotations.concurrent;

public @interface UiThread {
}

0 comments on commit 3810924

Please sign in to comment.