mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Do export only activities that need to react to external intents
For some reason SettingsActivity does not need to be exported for it to be launched from system app settings. androidx.test.ext:junit needed to be upgraded because it somehow brought in an activity without exported attribute
This commit is contained in:
@@ -148,7 +148,7 @@ dependencies {
|
||||
testAnnotationProcessor "com.google.dagger:dagger-compiler:$dagger_version"
|
||||
|
||||
androidTestImplementation project(path: ':bramble-api', configuration: 'testOutput')
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
|
||||
androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion"
|
||||
androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion"
|
||||
|
||||
@@ -49,8 +49,7 @@
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/BriarTheme"
|
||||
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute"
|
||||
tools:targetApi="16">
|
||||
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute">
|
||||
|
||||
<receiver
|
||||
android:name="org.briarproject.briar.android.login.SignInReminderReceiver"
|
||||
@@ -98,22 +97,27 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.splash.ExpiredActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/app_name" />
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.splash.ExpiredOldAndroidActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/app_name" />
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.login.StartupActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/app_name" />
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.account.SetupActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/setup_title" />
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.splash.SplashScreenActivity"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/BriarTheme.NoActionBar">
|
||||
<intent-filter>
|
||||
@@ -126,6 +130,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/BriarTheme.NoActionBar">
|
||||
<intent-filter android:label="@string/add_contact_remotely_title_case">
|
||||
@@ -145,6 +150,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.conversation.ConversationActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/app_name"
|
||||
android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
|
||||
android:theme="@style/BriarTheme.NoActionBar"
|
||||
@@ -156,6 +162,7 @@
|
||||
|
||||
<activity
|
||||
android:name=".android.conversation.ImageActivity"
|
||||
android:exported="false"
|
||||
android:parentActivityName="org.briarproject.briar.android.conversation.ConversationActivity"
|
||||
android:theme="@style/BriarTheme.ActionBarOverlay">
|
||||
<meta-data
|
||||
@@ -165,6 +172,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.privategroup.creation.CreateGroupActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/groups_create_group_title"
|
||||
android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
|
||||
android:windowSoftInputMode="adjustResize|stateAlwaysVisible">
|
||||
@@ -175,6 +183,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.privategroup.conversation.GroupActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/app_name"
|
||||
android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
|
||||
android:theme="@style/BriarTheme.NoActionBar"
|
||||
@@ -186,6 +195,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.privategroup.invitation.GroupInvitationActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/groups_invitations_title"
|
||||
android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity">
|
||||
<meta-data
|
||||
@@ -195,6 +205,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.privategroup.memberlist.GroupMemberListActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/groups_member_list"
|
||||
android:parentActivityName="org.briarproject.briar.android.privategroup.conversation.GroupActivity">
|
||||
<meta-data
|
||||
@@ -204,6 +215,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.privategroup.reveal.RevealContactsActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/groups_reveal_contacts"
|
||||
android:parentActivityName="org.briarproject.briar.android.privategroup.conversation.GroupActivity">
|
||||
<meta-data
|
||||
@@ -213,6 +225,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.privategroup.creation.GroupInviteActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/groups_invite_members"
|
||||
android:parentActivityName="org.briarproject.briar.android.privategroup.conversation.GroupActivity"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden">
|
||||
@@ -223,6 +236,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.sharing.ForumInvitationActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/forum_invitations_title"
|
||||
android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity">
|
||||
<meta-data
|
||||
@@ -232,6 +246,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.sharing.BlogInvitationActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/blogs_sharing_invitations_title"
|
||||
android:parentActivityName="org.briarproject.briar.android.conversation.ConversationActivity">
|
||||
<meta-data
|
||||
@@ -241,6 +256,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.forum.CreateForumActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/create_forum_title"
|
||||
android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
|
||||
android:windowSoftInputMode="adjustResize|stateAlwaysVisible">
|
||||
@@ -251,6 +267,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.forum.ForumActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/app_name"
|
||||
android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
|
||||
android:theme="@style/BriarTheme.NoActionBar"
|
||||
@@ -262,6 +279,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.sharing.ShareForumActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/activity_share_toolbar_header"
|
||||
android:parentActivityName="org.briarproject.briar.android.forum.ForumActivity"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden">
|
||||
@@ -272,6 +290,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.sharing.ShareBlogActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/activity_share_toolbar_header"
|
||||
android:parentActivityName="org.briarproject.briar.android.blog.BlogActivity"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden">
|
||||
@@ -282,6 +301,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.sharing.ForumSharingStatusActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/sharing_status"
|
||||
android:parentActivityName="org.briarproject.briar.android.forum.ForumActivity">
|
||||
<meta-data
|
||||
@@ -291,6 +311,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.sharing.BlogSharingStatusActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/sharing_status"
|
||||
android:parentActivityName="org.briarproject.briar.android.blog.BlogActivity">
|
||||
<meta-data
|
||||
@@ -300,6 +321,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.blog.BlogActivity"
|
||||
android:exported="false"
|
||||
android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
|
||||
android:theme="@style/BriarTheme.NoActionBar">
|
||||
<meta-data
|
||||
@@ -309,6 +331,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.blog.WriteBlogPostActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/blogs_write_blog_post"
|
||||
android:parentActivityName="org.briarproject.briar.android.blog.BlogActivity"
|
||||
android:windowSoftInputMode="adjustResize|stateAlwaysVisible">
|
||||
@@ -319,6 +342,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.blog.ReblogActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/blogs_reblog_button"
|
||||
android:parentActivityName="org.briarproject.briar.android.blog.BlogActivity"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden">
|
||||
@@ -329,6 +353,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.contact.add.nearby.AddNearbyContactActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/add_contact_title"
|
||||
android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
|
||||
android:theme="@style/BriarTheme.NoActionBar">
|
||||
@@ -339,6 +364,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.introduction.IntroductionActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/introduction_activity_title"
|
||||
android:parentActivityName="org.briarproject.briar.android.conversation.ConversationActivity"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden">
|
||||
@@ -359,6 +385,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.settings.SettingsActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/settings_button"
|
||||
android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity"
|
||||
android:permission="android.permission.READ_NETWORK_USAGE_HISTORY">
|
||||
@@ -373,6 +400,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.navdrawer.TransportsActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/network_settings_title"
|
||||
android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity">
|
||||
<meta-data
|
||||
@@ -382,6 +410,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.login.ChangePasswordActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/change_password"
|
||||
android:parentActivityName="org.briarproject.briar.android.settings.SettingsActivity"
|
||||
android:windowSoftInputMode="adjustResize|stateAlwaysVisible">
|
||||
@@ -392,6 +421,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.test.TestDataActivity"
|
||||
android:exported="false"
|
||||
android:label="Create test data"
|
||||
android:parentActivityName="org.briarproject.briar.android.settings.SettingsActivity">
|
||||
<meta-data
|
||||
@@ -401,6 +431,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.panic.PanicPreferencesActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/panic_setting"
|
||||
android:parentActivityName="org.briarproject.briar.android.settings.SettingsActivity">
|
||||
<meta-data
|
||||
@@ -410,6 +441,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.panic.PanicResponderActivity"
|
||||
android:exported="true"
|
||||
android:noHistory="true"
|
||||
android:theme="@style/TranslucentTheme">
|
||||
<!-- this can never have launchMode singleTask or singleInstance! -->
|
||||
@@ -421,26 +453,31 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.logout.ExitActivity"
|
||||
android:exported="false"
|
||||
android:theme="@android:style/Theme.NoDisplay" />
|
||||
|
||||
<activity
|
||||
android:name=".android.logout.HideUiActivity"
|
||||
android:exported="false"
|
||||
android:theme="@android:style/Theme.NoDisplay" />
|
||||
|
||||
<activity
|
||||
android:name=".android.account.UnlockActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/lock_unlock"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/BriarTheme.NoActionBar" />
|
||||
|
||||
<activity
|
||||
android:name=".android.contact.add.remote.AddContactActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/add_contact_remotely_title_case"
|
||||
android:theme="@style/BriarTheme"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden" />
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.blog.RssFeedActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/blogs_rss_feeds"
|
||||
android:parentActivityName="org.briarproject.briar.android.navdrawer.NavDrawerActivity">
|
||||
<meta-data
|
||||
@@ -450,6 +487,7 @@
|
||||
|
||||
<activity
|
||||
android:name="org.briarproject.briar.android.removabledrive.RemovableDriveActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/removable_drive_menu_title"
|
||||
android:parentActivityName="org.briarproject.briar.android.conversation.ConversationActivity">
|
||||
<meta-data
|
||||
@@ -459,11 +497,13 @@
|
||||
|
||||
<activity
|
||||
android:name=".android.contact.add.remote.PendingContactListActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/pending_contact_requests"
|
||||
android:theme="@style/BriarTheme" />
|
||||
|
||||
<activity
|
||||
android:name=".android.hotspot.HotspotActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/hotspot_title"
|
||||
android:theme="@style/BriarTheme" />
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.briarproject.briar.android.settings;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
|
||||
@@ -18,6 +19,8 @@ import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
import androidx.preference.PreferenceFragmentCompat.OnPreferenceStartFragmentCallback;
|
||||
|
||||
import static android.content.Intent.ACTION_MANAGE_NETWORK_USAGE;
|
||||
|
||||
@MethodsNotNullByDefault
|
||||
@ParametersNotNullByDefault
|
||||
public class SettingsActivity extends BriarActivity
|
||||
@@ -40,12 +43,18 @@ public class SettingsActivity extends BriarActivity
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
// show display fragment after theme change
|
||||
Bundle extras = getIntent().getExtras();
|
||||
Intent i = getIntent();
|
||||
Bundle extras = i.getExtras();
|
||||
if (bundle == null && extras != null &&
|
||||
extras.getBoolean(EXTRA_THEME_CHANGE, false)) {
|
||||
// show display fragment after theme change
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
showNextFragment(fragmentManager, new DisplayFragment());
|
||||
} else if (bundle == null &&
|
||||
ACTION_MANAGE_NETWORK_USAGE.equals(i.getAction())) {
|
||||
// show connection if coming from network settings
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
showNextFragment(fragmentManager, new ConnectionsFragment());
|
||||
}
|
||||
|
||||
setContentView(R.layout.activity_settings);
|
||||
|
||||
@@ -54,14 +54,11 @@ dependencyVerification {
|
||||
'androidx.test.espresso:espresso-core:3.3.0:espresso-core-3.3.0.aar:23ebf6014645e0c60aec7d1ed924d4d4c848ae8c3673b7d8d06b2ec6a56cafee',
|
||||
'androidx.test.espresso:espresso-idling-resource:3.3.0:espresso-idling-resource-3.3.0.aar:29519b112731f289cc6e2f9b2eccc5ea72c754b04272bb93370f45d7e170a7c6',
|
||||
'androidx.test.espresso:espresso-intents:3.3.0:espresso-intents-3.3.0.aar:5b6cd6aadce78edc705d93c1e81ace3b59be97128aca0e88fd9c5c176aa9bf10',
|
||||
'androidx.test.ext:junit:1.1.2:junit-1.1.2.aar:6c6ab120c640bf16fcaae69cb83c144d0ed6b6298562be0ac35e37ed969c0409',
|
||||
'androidx.test.ext:junit:1.1.3:junit-1.1.3.aar:a97209d75a9a85815fa8934f5a4a320de1163ffe94e2f0b328c0c98a59660690',
|
||||
'androidx.test.services:storage:1.4.0:storage-1.4.0.aar:35cfbf442abb83e5876cd5deb9de02ae047459f18f831097c5caa76d626bc38a',
|
||||
'androidx.test.services:test-services:1.3.0:test-services-1.3.0.apk:1b88faab6864baf25c5d0b92a610c283c159a566e7a56c03307117fa1b542993',
|
||||
'androidx.test.uiautomator:uiautomator:2.2.0:uiautomator-2.2.0.aar:2838e9d961dbffefbbd229a2bd4f6f82ac4fb2462975862a9e75e9ed325a3197',
|
||||
'androidx.test:core:1.3.0:core-1.3.0.aar:86549cae8c5b848f817e2c716e174c7dab61caf0b4df9848680eeb753089a337',
|
||||
'androidx.test:core:1.4.0:core-1.4.0.aar:671284e62e393f16ceae1a99a3a9a07bf1aacda29f8fe7b6b884355ef34c09cf',
|
||||
'androidx.test:monitor:1.3.0:monitor-1.3.0.aar:f73a31306a783e63150c60c49e140dc38da39a1b7947690f4b73387b5ebad77e',
|
||||
'androidx.test:monitor:1.4.0:monitor-1.4.0.aar:46a912a1e175f27a97521af3f50e5af87c22c49275dd2c57c043740012806325',
|
||||
'androidx.test:orchestrator:1.3.0:orchestrator-1.3.0.apk:676f808d08a3d05050eae30c3b7d92ce5cef1e00a54d68355bb7e7d4b72366fe',
|
||||
'androidx.test:rules:1.3.0:rules-1.3.0.aar:c1753946c498b0d5d7cf341cfed661f66915c4c9deb4ed10462a08ae33b2429a',
|
||||
|
||||
Reference in New Issue
Block a user