Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit 5f70d943 authored by Marvin W.'s avatar Marvin W. 🐿️
Browse files

Add initial Exposure Notification API implementation

parent af28a78b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ buildscript {

    ext.annotationVersion = '1.1.0'
    ext.appcompatVersion = '1.1.0'
    ext.coreVersion = '1.3.0'
    ext.fragmentVersion = '1.2.5'
    ext.lifecycleVersion = '2.2.0'
    ext.mediarouterVersion = '1.1.0'
+4 −0
Original line number Diff line number Diff line
@@ -19,3 +19,7 @@ wire {
compileKotlin {
    kotlinOptions.jvmTarget = 1.8
}

compileTestKotlin {
    kotlinOptions.jvmTarget = 1.8
}
+2 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ configurations {
dependencies {
    implementation "com.squareup.wire:wire-runtime:$wireVersion"
    implementation "de.hdodenhof:circleimageview:1.3.0"
    implementation "com.diogobernardino:williamchart:3.7.1"
    implementation "org.conscrypt:conscrypt-android:2.1.0"
    // TODO: Switch to upstream once raw requests are merged
    // https://github.com/vitalidze/chromecast-java-api-v2/pull/99
@@ -40,6 +41,7 @@ dependencies {
    implementation project(':firebase-dynamic-links-api')
    implementation project(':play-services-base-core')
    implementation project(':play-services-location-core')
    implementation project(':play-services-nearby-core')
    implementation project(':play-services-core-proto')
    implementation project(':play-services-core:microg-ui-tools') // deprecated
    implementation project(':play-services-api')
+12 −1
Original line number Diff line number Diff line
@@ -107,6 +107,8 @@
        android:name="android.permission.UPDATE_APP_OPS_STATS"
        tools:ignore="ProtectedPermissions" />

    <uses-sdk tools:overrideLibrary="com.db.williamchart" />

    <application
        android:name="androidx.multidex.MultiDexApplication"
        android:allowBackup="false"
@@ -419,6 +421,15 @@

        <!-- microG custom UI -->

        <activity
            android:name="org.microg.gms.ui.ExposureNotificationsConfirmActivity"
            android:exported="false"
            android:theme="@style/Theme.AppCompat.DayNight.Dialog.Alert.NoActionBar">
            <intent-filter>
                <action android:name="org.microg.gms.nearby.exposurenotification.CONFIRM" />
            </intent-filter>
        </activity>

        <!-- microG Settings shown in Launcher -->
        <activity
            android:name="org.microg.gms.ui.SettingsActivity"
@@ -427,11 +438,11 @@
            android:roundIcon="@mipmap/ic_microg_settings">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.APPLICATION_PREFERENCES" />
                <action android:name="com.google.android.gms.settings.EXPOSURE_NOTIFICATION_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
+10 −0
Original line number Diff line number Diff line
package org.microg.gms.ui;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

import androidx.annotation.Nullable;
@@ -11,6 +13,8 @@ import androidx.navigation.ui.NavigationUI;

import com.google.android.gms.R;

import org.microg.gms.nearby.exposurenotification.Constants;

public class SettingsActivity extends AppCompatActivity {
    private AppBarConfiguration appBarConfiguration;

@@ -21,6 +25,12 @@ public class SettingsActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Intent intent = getIntent();
        if (Constants.ACTION_EXPOSURE_NOTIFICATION_SETTINGS.equals(intent.getAction()) && intent.getData() == null) {
            intent.setData(Uri.parse("x-gms-settings://exposure-notifications"));
        }

        setContentView(R.layout.settings_root_activity);

        appBarConfiguration = new AppBarConfiguration.Builder(getNavController().getGraph()).build();
Loading