Skip to content

Commit b373617

Browse files
Fixes #4682 - Removed read_phone_state_permission (#4723)
1 parent d8f7d89 commit b373617

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

app/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ dependencies {
4141
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.1.0'
4242
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-localization-v8:0.11.0'
4343
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-scalebar-v9:0.4.0'
44+
implementation 'com.mapbox.mapboxsdk:mapbox-android-telemetry:6.1.0'
4445
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
4546
implementation 'com.dinuscxj:circleprogressbar:1.1.1'
4647
implementation 'com.karumi:dexter:5.0.0'

app/src/main/AndroidManifest.xml

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<uses-permission android:name="com.google.android.apps.photos.permission.GOOGLE_PHOTOS" />
1818
<uses-permission android:name="android.permission.SET_WALLPAPER"/>
1919
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
20-
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
2120

2221

2322

app/src/main/java/fr/free/nrw/commons/contributions/MainActivity.java

+1-17
Original file line numberDiff line numberDiff line change
@@ -143,31 +143,15 @@ public void setSelectedItemId(int id) {
143143

144144
private void setUpPager() {
145145
tabLayout.setOnNavigationItemSelectedListener(item -> {
146-
if (VERSION.SDK_INT >= VERSION_CODES.M) {
147-
if (item.getTitle().equals(getString(R.string.nearby_fragment))
148-
&& checkSelfPermission(permission.READ_PHONE_STATE)
149-
!= PackageManager.PERMISSION_GRANTED) {
150-
requestPhoneStatePermission(() -> {
151-
tabLayout.setSelectedItemId(NavTab.NEARBY.code());
152-
});
153-
return false;
154-
}
155-
}
156146
if (!item.getTitle().equals(getString(R.string.more))) {
157147
// do not change title for more fragment
158148
setTitle(item.getTitle());
159149
}
160-
Fragment fragment = NavTab.of(item.getOrder()).newInstance();
150+
final Fragment fragment = NavTab.of(item.getOrder()).newInstance();
161151
return loadFragment(fragment, true);
162152
});
163153
}
164154

165-
private void requestPhoneStatePermission(final Runnable runnable) {
166-
PermissionUtils.checkPermissionsAndPerformAction(this,
167-
android.Manifest.permission.READ_PHONE_STATE, (Runnable) runnable::run, (Runnable) () -> {
168-
}, R.string.need_permission, R.string.read_phone_state_permission_message);
169-
}
170-
171155
private void setUpLoggedOutPager() {
172156
loadFragment(ExploreFragment.newInstance(),false);
173157
tabLayout.setOnNavigationItemSelectedListener(item -> {

0 commit comments

Comments
 (0)