Commit 1c4d2777 authored by Torsten Grote's avatar Torsten Grote

Don't route intents for MANAGE_NETWORK_USAGE settings

This is because we require a special permission to launch this intent
and we prefer requiring this permission to having the NavDrawerActivity
added to the back stack.

This commit also re-adds the deprecated USE_FINGERPRINT permission as
Android Studio would show an error otherwise.
parent fb10ba58
......@@ -21,6 +21,8 @@
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<!--suppress DeprecatedClassUsageInspection -->
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
......@@ -104,11 +106,6 @@
android:name="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
android:launchMode="singleTask"
android:theme="@style/BriarTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MANAGE_NETWORK_USAGE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter android:label="@string/add_contact_remotely_title_case">
<action android:name="android.intent.action.VIEW"/>
......@@ -122,7 +119,6 @@
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain"/>
</intent-filter>
</activity>
<activity
......@@ -364,6 +360,10 @@
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.briarproject.briar.android.navdrawer.NavDrawerActivity"/>
<intent-filter>
<action android:name="android.intent.action.MANAGE_NETWORK_USAGE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity
......
......@@ -66,6 +66,8 @@ public abstract class BriarActivity extends BaseActivity {
@Nullable Intent data) {
super.onActivityResult(request, result, data);
if (request == REQUEST_PASSWORD) {
// We get RESULT_CANCELED when the account gets deleted or
// StartupActivity finishes before entering the password.
if (result == RESULT_OK) briarController.startAndBindService();
} else if (request == REQUEST_UNLOCK && result != RESULT_OK) {
// We arrive here, if the user presses 'back'
......
......@@ -5,9 +5,7 @@ import android.content.Intent;
import org.briarproject.briar.android.activity.BriarActivity;
import org.briarproject.briar.android.contact.add.remote.AddContactActivity;
import org.briarproject.briar.android.settings.SettingsActivity;
import static android.content.Intent.ACTION_MANAGE_NETWORK_USAGE;
import static android.content.Intent.ACTION_SEND;
import static android.content.Intent.ACTION_VIEW;
import static android.content.Intent.EXTRA_TEXT;
......@@ -29,10 +27,6 @@ class IntentRouter {
LINK_REGEX.matcher(i.getStringExtra(EXTRA_TEXT)).find()) {
redirect(ctx, i, AddContactActivity.class);
}
// network settings as launched from system settings app
else if (ACTION_MANAGE_NETWORK_USAGE.equals(action)) {
redirect(ctx, i, SettingsActivity.class);
}
}
private static void redirect(Context ctx, Intent i,
......
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