Commit de8d1b7d authored by Torsten Grote's avatar Torsten Grote

Allow sign out by trusted non-paired panic apps

parent 9155f62d
......@@ -97,14 +97,12 @@ public class PanicPreferencesFragment extends PreferenceFragmentCompat
showPanicApp(packageName);
if (packageName.equals(Panic.PACKAGE_NAME_NONE)) {
lockPref.setEnabled(false);
purgePref.setChecked(false);
purgePref.setEnabled(false);
uninstallPref.setChecked(false);
uninstallPref.setEnabled(false);
getActivity().setResult(Activity.RESULT_CANCELED);
} else {
lockPref.setEnabled(true);
purgePref.setEnabled(true);
uninstallPref.setEnabled(true);
}
......@@ -179,8 +177,7 @@ public class PanicPreferencesFragment extends PreferenceFragmentCompat
panicAppPref.setIcon(
android.R.drawable.ic_menu_close_clear_cancel);
// disable panic actions
lockPref.setEnabled(false);
// disable destructive panic actions
purgePref.setEnabled(false);
uninstallPref.setEnabled(false);
} else {
......@@ -192,8 +189,7 @@ public class PanicPreferencesFragment extends PreferenceFragmentCompat
panicAppPref.setIcon(
pm.getApplicationIcon(triggerPackageName));
// enable panic actions
lockPref.setEnabled(true);
// enable destructive panic actions
purgePref.setEnabled(true);
uninstallPref.setEnabled(true);
} catch (PackageManager.NameNotFoundException e) {
......
......@@ -71,11 +71,13 @@ public class PanicResponderActivity extends BriarActivity {
} else if (sharedPref.getBoolean(KEY_PURGE, false)) {
LOG.info("Purging all data...");
deleteAllData();
} else if (sharedPref.getBoolean(KEY_LOCK, true)) {
LOG.info("Signing out...");
signOut(true);
}
}
// non-destructive actions are allowed by non-connected trusted apps
if (sharedPref.getBoolean(KEY_LOCK, true)) {
LOG.info("Signing out...");
signOut(true);
}
}
}
......
......@@ -10,7 +10,6 @@
<SwitchPreference
android:defaultValue="true"
android:enabled="false"
android:key="pref_key_lock"
android:summary="@string/panic_setting_signout_summary"
android:title="@string/panic_setting_signout_title"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment