FileDocCategorySizeDatePackage
ExternalSharedPermsDiffKeyTest.javaAPI DocAndroid 5.1 API2277Thu Mar 12 22:22:12 GMT 2015com.android.framework.externalsharedpermsdiffkeytestapp

ExternalSharedPermsDiffKeyTest

public class ExternalSharedPermsDiffKeyTest extends android.test.InstrumentationTestCase

Fields Summary
private static final int
REQUEST_ENABLE_BT
Constructors Summary
Methods Summary
public voidtestRunBluetoothAndFineLocation()
The use of location manager and bluetooth below are simply to simulate an app that tries to use them, so we can verify whether permissions are granted and accessible.


                                   
      
    
        LocationManager locationManager = (LocationManager)getInstrumentation().getContext(
                ).getSystemService(Context.LOCATION_SERVICE);
        locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,
                new LocationListener() {
                        public void onLocationChanged(Location location) {}
                        public void onProviderDisabled(String provider) {}
                        public void onProviderEnabled(String provider) {}
                        public void onStatusChanged(String provider, int status, Bundle extras) {}
                }
        );
        BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

        if ((mBluetoothAdapter != null) && (!mBluetoothAdapter.isEnabled())) {
            mBluetoothAdapter.getName();
        }
        fail("this app was signed by a different cert and should crash/fail to run by now");