- Moved permissions to only ask when required
This commit is contained in:
parent
484de114a4
commit
0cd6972a30
@ -6,8 +6,8 @@ android {
|
|||||||
applicationId "net.schueller.peertube"
|
applicationId "net.schueller.peertube"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 103
|
versionCode 104
|
||||||
versionName "1.0.3"
|
versionName "1.0.4"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
@ -279,8 +279,8 @@ public class VideoListActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Force android to not use SSLv3
|
* Force android to not use SSLv3
|
||||||
*
|
* <p>
|
||||||
// * @param callingActivity Activity
|
* // * @param callingActivity Activity
|
||||||
*/
|
*/
|
||||||
// private void updateAndroidSecurityProvider(Activity callingActivity) {
|
// private void updateAndroidSecurityProvider(Activity callingActivity) {
|
||||||
// try {
|
// try {
|
||||||
@ -293,12 +293,13 @@ public class VideoListActivity extends AppCompatActivity {
|
|||||||
// Log.e("SecurityException", "Google Play Services not available.");
|
// Log.e("SecurityException", "Google Play Services not available.");
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
// only check when we actually need the permission
|
||||||
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||||
|
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED &&
|
||||||
|
sharedPref.getBoolean("pref_torrent_player", false)) {
|
||||||
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 0);
|
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
<string name="pref_description_show_nsfw">NSFW content will be shown if enabled.</string>
|
<string name="pref_description_show_nsfw">NSFW content will be shown if enabled.</string>
|
||||||
<string name="title_activity_url_video_play">UrlVideoPlayActivity</string>
|
<string name="title_activity_url_video_play">UrlVideoPlayActivity</string>
|
||||||
<string name="pref_title_torrent_player">Torrent Video Player</string>
|
<string name="pref_title_torrent_player">Torrent Video Player</string>
|
||||||
<string name="pref_description_torrent_player">Videos playback via a torrent stream</string>
|
<string name="pref_description_torrent_player">Video playback via a torrent stream. This requires Storage Permissions.</string>
|
||||||
<string name="pref_title_license">License</string>
|
<string name="pref_title_license">License</string>
|
||||||
<string name="pref_description_license">\n<b>GNU Affero General Public License v3.0</b>\n\nPermissions of this strongest copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. When a modified version is used to provide a service over a network, the complete source code of the modified version must be made available.</string>
|
<string name="pref_description_license">\n<b>GNU Affero General Public License v3.0</b>\n\nPermissions of this strongest copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. When a modified version is used to provide a service over a network, the complete source code of the modified version must be made available.</string>
|
||||||
<string name="pref_title_version">Version</string>
|
<string name="pref_title_version">Version</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user