Unit test for AppLocationPermissionPreferenceController

Bug: 120910747
Test: build and run the unit test
Change-Id: Id5f79d0f6b143d1ef5e37d75c27a64b4e1dcd9e0
This commit is contained in:
Lifu Tang
2018-12-27 12:33:05 -08:00
parent 5585d5e9d7
commit 769a9fb04c
2 changed files with 45 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import android.location.LocationManager;
import android.permission.PermissionControllerManager;
import android.provider.Settings;
import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
import com.android.settings.R;
@@ -24,9 +25,11 @@ public class AppLocationPermissionPreferenceController extends
private static final String KEY_APP_LEVEL_PERMISSIONS = "app_level_permissions";
/** Total number of apps that has location permission. */
private int mNumTotal = -1;
@VisibleForTesting
int mNumTotal = -1;
/** Total number of apps that has background location permission. */
private int mNumBackground = -1;
@VisibleForTesting
int mNumBackground = -1;
private final LocationManager mLocationManager;
private Preference mPreference;