CONTROL_LOCATION_UPDATES permission failure

by alexdonnini » Thu, 09 Apr 2009 18:17:36 GMT


Sponsored Links
 Hello,

Although the manifest file in my application contains

<uses-permission
android:name="android.permission.CONTROL_LOCATION_UPDATES" />

the operation,

mTelephonyManager.enableLocationUpdates();

fails with

04-09 14:01:01.754: WARN/System.err(5495):
java.lang.SecurityException: Neither user 10026 nor current process
has android.permission.CONTROL_LOCATION_UPDATES.

Could anyone help me understand where I am making a mistake, and how
to correct it?

Thanks.

Alex Donnini
--~--~---------~--~----~------------~-------~--~----~



CONTROL_LOCATION_UPDATES permission failure

by Mike Lockwood » Thu, 09 Apr 2009 18:29:56 GMT


 The CONTROL_LOCATION_UPDATES permission has:
android:protectionLevel="signature", which means only applications
built into the system image can have this permission.

Mike






-- 
Mike Lockwood
Google android team

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


CONTROL_LOCATION_UPDATES permission failure

by alexdonnini » Thu, 09 Apr 2009 19:56:52 GMT


 Thanks for the response.

This means that applications do not have access to cell (tower)
location tracking information, is this right?

What is  the CONTROL_LOCATION_UPDATES permission used for?

Do you have any suggestions as to how an application could track the
the cell (tower) a phone is connected/closest to?

Doesn't the maps application do that when users select the wireless
network as the tracking vehicle?

Thanks.

Alex Donnini




--~--~---------~--~----~------------~-------~--~----~



CONTROL_LOCATION_UPDATES permission failure

by alexdonnini » Fri, 10 Apr 2009 02:16:13 GMT


 Hello,

Although the manifest file in my application contains

<uses-permission
android:name="android.permission.CONTROL_LOCATION_UPDATES" />

the operation,

mTelephonyManager.enableLocationUpdates();

fails with

04-09 14:01:01.754: WARN/System.err(5495):
java.lang.SecurityException: Neither user 10026 nor current process
has android.permission.CONTROL_LOCATION_UPDATES.

Could anyone help me understand where I am making a mistake, and how
to correct it?

Thanks.

Alex Donnini
--~--~---------~--~----~------------~-------~--~----~



CONTROL_LOCATION_UPDATES permission failure

by Richard Schilling » Fri, 10 Apr 2009 07:33:08 GMT


 I have the SDK version 1.1r1 on my machine, and Actually don't see
this API call in the current version.  What version of the SDK are you
using?

Anyway, I assume you want to cell tower location and such.  Try
creating a listener, and then registering your listener with the
TelephonyManager.

Start by giving your application the following permissions:

     android.permission.ACCESS_FINE_LOCATION
     android.permission.ACCES_COARSE_LOCATION

Then, create your listener:


// implement both phone state listener and location listener.
public class PhoneSignalListener extends PhoneStateListener
        implements LocationListener{


        /**
         * @param signalStrength signal strength in ACU.
         */
        public void onSignalStrengthChanged(int signalStrength){

                float signalPercent = ((float)signalStrength)/31f * 100f;
                SignalStrength.setSignalStrength(signalPercent);
                SignalStrength.setSignalStrengthASU(signalStrength);

        }

        public void onCellLocationChanged(CellLocation cellLoc){}

        public void onLocationChanged(Location loc) {}

        public void onProviderDisabled(String arg0) {}

        public void onProviderEnabled(String arg0) {}

        public void onStatusChanged(String arg0, int arg1, Bundle arg2) {}

}



And then you register it with TelephonyManager.  In your application's
main activity (Activity.onCreate()):

public class MyActivity extends Activity{


    public void onCreate(Bundle savedInstanceState) {
        TelephonyManager telManager = (TelephonyManager)
this.getSystemService(Context.TELEPHONY_SERVICE);
        telManager.listen(new PhoneSignalListener(),
                        PhoneStateListener.LISTEN_SERVICE_STATE |
                        PhoneStateListener.LISTEN_SIGNAL_STRENGTH |
                        PhoneStateListener.LISTEN_CELL_LOCATION);
    }
}


As the phone location changes you get the information delivered,
wrapped in a pretty package with a bow, to the Phone signal listener.


Richard Schilling
Root Wireless




--~--~---------~--~----~------------~-------~--~----~



CONTROL_LOCATION_UPDATES permission failure

by alexdonnini » Fri, 10 Apr 2009 10:18:54 GMT


 Hello Richard,

Thanks very much. This is very helpful. I am using the same SDK
version but in this case I was not using the SDK.

I had been experimenting with LocationListener too. I had been using
onLocationChanged.

Again, Thanks.

Alex Donnini

On Apr 9, 7:32pm, Richard Schilling <richard.rootwirel...@gmail.com>



--~--~---------~--~----~------------~-------~--~----~



CONTROL_LOCATION_UPDATES permission failure

by alexdonnini » Fri, 10 Apr 2009 23:58:48 GMT


 ello again Richard,

I have a quick question.

The SignalStrength class and setSignalStrength methods in the two
lines below are not part of the Android SDK or other Android telephony
related classes. Did you write it, or did you find it somewhere else?

SignalStrength.setSignalStrength(signalPercent);
SignalStrength.setSignalStrengthASU(signalStrength);

Thanks.

Alex Donnini

On Apr 9, 10:18pm, alexdonnini <alexdonn...@ieee.org> wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Htc legend first impression

Barusan tadi maen2 ama HTC Legend

Bentuknya kombinasi hero+magic, berdagu tapi tidak terlalu seperti hero.

Bodinya as expected memang seperti MBP, di cut dati one alumunium block

UI mirip hero + uda bisa exposure, di nativenya cepet sekali dan gak ada lack

Sorry no photo soalnya NDA, di backgroundnya aja masih ada tulisan HTC 
Confidential

Gak sabar untuk test drive yang desire :)

Thx untuk boss htc udah pinjemin
~AJ

-- 
"Indonesian Android Community [id-android]" 

2. AudioPolicyManager

In the current implementation given in AudioPolicyManager the BT
headset has got the highest priority and DEVICE_OUT_WIRED_HEADSET  has
got the second priority.

Priority means:When both are connected then the audio will come from
BT headset and if you remove BT headset audio will come from
DEVICE_OUT_WIRED_HEADSET.

I wanted to change the priority(wanted to give high priority to
DEVICE_OUT_WIRED_HEADSET instead of BT headset) but just changing
getDeviceForStrategy() function will not change the priority as we
need to take care of situation below:

a. when both are connected
b. remove the DEVICE_OUT_WIRED_HEADSET,this should transfer the audio
streams from  WIRED_HEADSET to BT headset.

Please suggest the changes required to get this done apart from the
change in getDeviceForStrategy function.

-- 

3. Which View/Layout does the Market app (1.6) details activity use?

4. Which View/Layout does the Market app (1.6) details activity use?

5. Besok ke GI

6. Defining permission

7. How many SurfaceHolder objects can be created in one activity having one view?