1
0
mirror of https://github.com/etesync/android synced 2025-01-11 08:10:58 +00:00

Fix some inconsistencies

This commit is contained in:
Ricki Hirner 2017-04-02 19:19:38 +02:00 committed by Tom Hacohen
parent 138d344a5b
commit 51840c3a22
4 changed files with 11 additions and 8 deletions

View File

@ -55,11 +55,11 @@
tools:ignore="UnusedAttribute"> tools:ignore="UnusedAttribute">
<receiver <receiver
android:name=".App$ReinitLoggingReceiver" android:name=".App$ReinitSettingsReceiver"
android:exported="false" android:exported="false"
android:process=":sync"> android:process=":sync">
<intent-filter> <intent-filter>
<action android:name="com.etesync.syncadapter.REINIT_LOGGER"/> <action android:name="at.bitfire.davdroid.REINIT_SETTINGS"/>
</intent-filter> </intent-filter>
</receiver> </receiver>
<receiver <receiver

View File

@ -78,8 +78,6 @@ import okhttp3.internal.tls.OkHostnameVerifier;
public class App extends Application { public class App extends Application {
public static final String FLAVOR_GOOGLE_PLAY = "gplay";
public static final String public static final String
DISTRUST_SYSTEM_CERTIFICATES = "distrustSystemCerts", DISTRUST_SYSTEM_CERTIFICATES = "distrustSystemCerts",
LOG_TO_EXTERNAL_STORAGE = "logToExternalStorage", LOG_TO_EXTERNAL_STORAGE = "logToExternalStorage",
@ -216,11 +214,13 @@ public class App extends Application {
} }
public static class ReinitLoggingReceiver extends BroadcastReceiver { public static class ReinitSettingsReceiver extends BroadcastReceiver {
public static final String ACTION_REINIT_SETTINGS = BuildConfig.APPLICATION_ID + ".REINIT_SETTINGS";
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
log.info("Received broadcast: re-initializing logger"); log.info("Received broadcast: re-initializing settings (logger/cert manager)");
App app = (App)context.getApplicationContext(); App app = (App)context.getApplicationContext();
app.reinitLogger(); app.reinitLogger();

View File

@ -161,6 +161,9 @@ public class AppSettingsActivity extends AppCompatActivity {
// re-initialize certificate manager // re-initialize certificate manager
App app = (App)getContext().getApplicationContext(); App app = (App)getContext().getApplicationContext();
app.reinitCertManager(); app.reinitCertManager();
// reinitialize certificate manager of :sync process
getContext().sendBroadcast(new Intent(App.ReinitSettingsReceiver.ACTION_REINIT_SETTINGS));
} }
private void resetCertificates() { private void resetCertificates() {
@ -176,7 +179,7 @@ public class AppSettingsActivity extends AppCompatActivity {
app.reinitLogger(); app.reinitLogger();
// reinitialize logger of :sync process // reinitialize logger of :sync process
getContext().sendBroadcast(new Intent("com.etesync.syncadapter.REINIT_LOGGER")); getContext().sendBroadcast(new Intent(App.ReinitSettingsReceiver.ACTION_REINIT_SETTINGS));
} }
} }

View File

@ -7,7 +7,7 @@
--> -->
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android" <account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
android:accountType="com.etesync.syncadapter" android:accountType="@string/account_type"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:smallIcon="@mipmap/ic_launcher" android:smallIcon="@mipmap/ic_launcher"