NFC swap now goes to confirm swap, not manage repos activity.
The NFC message now is handled by the FDroid activity, so it is treated the same way as every other incoming repo URL. Because FDroid handles incoming intents correctly, the NFC one just magically works when the <intent-filter> is moved from ManageReposAcivity to FDroid without further code changes. The other change is that the two way swap only happens when both are actually swapping. Otherwise, we will send a request for someone to swap with us, when we are incapable of swapping with them. Fixes #267.
This commit is contained in:
parent
cbf59f9dd0
commit
9824e8df09
@ -210,6 +210,20 @@
|
||||
<data android:path="/store/search" />
|
||||
</intent-filter>
|
||||
|
||||
<!-- Handle NFC tags detected from outside our application -->
|
||||
<intent-filter>
|
||||
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<!--
|
||||
URIs that come in via NFC have scheme/host normalized to all lower case
|
||||
https://developer.android.com/reference/android/nfc/NfcAdapter.html#ACTION_NDEF_DISCOVERED
|
||||
-->
|
||||
<data android:scheme="fdroidrepo" />
|
||||
<data android:scheme="fdroidrepos" />
|
||||
</intent-filter>
|
||||
|
||||
<!-- Repo URLs -->
|
||||
|
||||
<!--
|
||||
@ -301,19 +315,6 @@
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".FDroid" />
|
||||
<!-- Handle NFC tags detected from outside our application -->
|
||||
<intent-filter>
|
||||
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<!--
|
||||
URIs that come in via NFC have scheme/host normalized to all lower case
|
||||
https://developer.android.com/reference/android/nfc/NfcAdapter.html#ACTION_NDEF_DISCOVERED
|
||||
-->
|
||||
<data android:scheme="fdroidrepo" />
|
||||
<data android:scheme="fdroidrepos" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
|
@ -156,7 +156,10 @@ public class ConnectSwapActivity extends ActionBarActivity implements ProgressLi
|
||||
RepoProvider.Helper.update(this, repo, values);
|
||||
}
|
||||
|
||||
if (!newRepoConfig.preventFurtherSwaps()) {
|
||||
// Only ask server to swap with us, if we are actually running a local repo service.
|
||||
// It is possible to have a swap initiated without first starting a swap, in which
|
||||
// case swapping back is pointless.
|
||||
if (!newRepoConfig.preventFurtherSwaps() && FDroidApp.isLocalRepoServiceRunning()) {
|
||||
askServerToSwapWithUs();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user