Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bdea62f7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove ACCESS_COARSE_LOCATION permission checking"

parents 5ade0ebf a27167db
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.settings.wifi;

import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
import static android.Manifest.permission.ACCESS_FINE_LOCATION;

import android.content.DialogInterface;
@@ -359,12 +358,6 @@ public class WifiDialogActivity extends ObservableActivity implements WifiDialog
            return false;
        }

        if (getPackageManager().checkPermission(ACCESS_COARSE_LOCATION, callingPackage)
                == PackageManager.PERMISSION_GRANTED) {
            Log.d(TAG, "The calling package has ACCESS_COARSE_LOCATION permission for result.");
            return true;
        }

        if (getPackageManager().checkPermission(ACCESS_FINE_LOCATION, callingPackage)
                == PackageManager.PERMISSION_GRANTED) {
            Log.d(TAG, "The calling package has ACCESS_FINE_LOCATION permission for result.");
+2 −2
Original line number Diff line number Diff line
@@ -310,7 +310,7 @@ public class WifiDialogActivityTest {
    }

    @Test
    public void hasPermissionForResult_hasCoarseLocationPermission_returnTrue() {
    public void hasPermissionForResult_hasCoarseLocationPermission_returnFalse() {
        WifiDialogActivity activity = spy(Robolectric.setupActivity(WifiDialogActivity.class));
        when(activity.getCallingPackage()).thenReturn(CALLING_PACKAGE);
        when(activity.getPackageManager()).thenReturn(mPackageManager);
@@ -321,7 +321,7 @@ public class WifiDialogActivityTest {

        final boolean result = activity.hasPermissionForResult();

        assertThat(result).isTrue();
        assertThat(result).isFalse();
    }

    @Test