Merge pull request #2461 from ByteHamster/fix-debug-provider

Fix install of debug version by using unique provider
This commit is contained in:
Martin Fietz 2017-10-22 07:38:29 +02:00 committed by GitHub
commit ee24c39fca
5 changed files with 6 additions and 4 deletions

View File

@ -72,6 +72,7 @@ android {
debug {
applicationIdSuffix ".debug"
resValue "string", "provider_authority", "de.danoeh.antennapod.debug.provider"
buildConfigField STRING, FLATTR_APP_KEY, mFlattrAppKey
buildConfigField STRING, FLATTR_APP_SECRET, mFlattrAppSecret
}

View File

@ -373,7 +373,7 @@
</receiver>
<provider
android:authorities="de.danoeh.antennapod.provider"
android:authorities="@string/provider_authority"
android:name="android.support.v4.content.FileProvider"
android:exported="false"
android:grantUriPermissions="true">

View File

@ -454,7 +454,7 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "AntennaPod Crash Report");
emailIntent.putExtra(Intent.EXTRA_TEXT, "Please describe what you were doing when the app crashed");
// the attachment
Uri fileUri = FileProvider.getUriForFile(context, "de.danoeh.antennapod.provider",
Uri fileUri = FileProvider.getUriForFile(context, context.getString(R.string.provider_authority),
CrashReportWriter.getFile());
emailIntent.putExtra(Intent.EXTRA_STREAM, fileUri);
emailIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

View File

@ -72,7 +72,7 @@ public class ShareUtils {
public static void shareFeedItemFile(Context context, FeedMedia media) {
Intent i = new Intent(Intent.ACTION_SEND);
i.setType(media.getMime_type());
Uri fileUri = FileProvider.getUriForFile(context, "de.danoeh.antennapod.provider",
Uri fileUri = FileProvider.getUriForFile(context, context.getString(R.string.provider_authority),
new File(media.getLocalMediaUrl()));
i.putExtra(Intent.EXTRA_STREAM, fileUri);
i.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
@ -84,6 +84,6 @@ public class ShareUtils {
}
}
context.startActivity(Intent.createChooser(i, context.getString(R.string.share_file_label)));
Log.e(TAG, "Foo");
Log.e(TAG, "shareFeedItemFile called");
}
}

View File

@ -5,6 +5,7 @@
<!-- Activitiy and fragment titles -->
<string name="app_name" translate="false">AntennaPod</string>
<string name="provider_authority" translate="false">de.danoeh.antennapod.provider</string>
<string name="feeds_label">Feeds</string>
<string name="statistics_label">Statistics</string>
<string name="add_feed_label">Add Podcast</string>