Re: how to get SDCARD serial number

2009-07-23 Thread Mike Lockwood

Actually we have support for that in android.  See getFatVolumeId() in
android.os.FileUtils.

This requires the following kernel patch in order to work:

http://android.git.kernel.org/?p=kernel/common.git;a=commitdiff;h=0cb89e58ee83afb87f57d054c787489602e4502a

Mike

On Thu, Jul 23, 2009 at 9:05 AM, Jean-Baptiste Queru wrote:
>
> I don't remember seeing an API for that, you'll need to contribute one.
>
> JBQ
>
> On Thu, Jul 23, 2009 at 5:53 AM, wang yitu wrote:
>>
>> Can someone tell me how to get the SDCARD serail number in android?
>> very appreciating for the answer.
>>
>> >
>>
>
>
>
> --
> Jean-Baptiste M. "JBQ" Queru
> Software Engineer, Android Open-Source Project, Google.
>
> Questions sent directly to me that have no reason for being private
> will likely get ignored or forwarded to a public forum with no further
> warning.
>
> >
>



-- 
Mike Lockwood
Google android team

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: SystemServer permissions ..

2009-07-07 Thread Mike Lockwood

Hi Dan,

I have been investigating this, and it looks to me that changing the
occurrences of  mContext.checkCallingPermission to
mContext.checkCallingOrSelfPermission in LocationManagerService.java
will fix the problem.

Mike

On Thu, Jun 25, 2009 at 12:56 PM, dan raaka wrote:
> anything on this one ?
>
> On Tue, Jun 23, 2009 at 6:53 PM, dan raaka  wrote:
>>
>> 2 lines all that was added ..
>> mLocationManager = (LocationManager)
>> context.getSystemService(Context.LOCATION_SERVICE);
>> mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0,
>> 0, new GpsListener());
>>
>> Here is the trace
>> E/SystemServer( 1861): java.lang.SecurityException: Requires
>> ACCESS_FINE_LOCATION permission
>> E/SystemServer( 1861):  at
>> com.android.server.LocationManagerService.checkPermissionsSafe(LocationManagerService.java:686)
>> E/SystemServer( 1861):  at
>> com.android.server.LocationManagerService._isProviderEnabledLocked(LocationManagerService.java:1510)
>> E/SystemServer( 1861):  at
>> com.android.server.LocationManagerService.isProviderEnabled(LocationManagerService.java:1499)
>> E/SystemServer( 1861):  at
>> android.location.LocationManager.isProviderEnabled(LocationManager.java:928)
>> E/SystemServer( 1861):  at
>> com.android.server.MyGPSManagerService.(MyGPSManagerService.java:277)
>> E/SystemServer( 1861):  at
>> com.android.server.ServerThread.run(SystemServer.java:263)
>>
>> -Dan
>>
>> On Tue, Jun 23, 2009 at 5:38 PM, Dianne Hackborn 
>> wrote:
>>>
>>> The system process gets all permissions (it is, after all, the one that
>>> manages and enforces permissions).  What is the stack crawl of the
>>> exception?
>>>
>>> On Tue, Jun 23, 2009 at 3:53 PM, Dan Raaka  wrote:
>>>>
>>>> System server is starting up other services, however, towards the end,
>>>> if we were add any code to access any of the started services, it
>>>> throws out a error saying PERMISSION not defined.
>>>>
>>>> E/SystemServer( 1861): java.lang.SecurityException: Requires
>>>> ACCESS_FINE_LOCATION permission
>>>>
>>>> The general mode is to create an apk with the service and hence we
>>>> will have a way to describe the required permissions in the manifest.
>>>> However, if we want to do the same in the platform, how can one add
>>>> permissions ? and what sort of permissions does SystemServer have (eg.
>>>> ACCESS_FINE_LOCATION )?
>>>>
>>>
>>>
>>>
>>> --
>>> Dianne Hackborn
>>> Android framework engineer
>>> hack...@android.com
>>>
>>> Note: please don't send private questions to me, as I don't have time to
>>> provide private support, and so won't reply to such e-mails.  All such
>>> questions should be posted on public forums, where I and others can see and
>>> answer them.
>>>
>>> >>>
>



-- 
Mike Lockwood
Google android team

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: adb remount fails on G1 with Android 1.5 images

2009-05-20 Thread Mike Lockwood

Hi Alan,

You haven't given me enough information to answer the hypothetical
question.  If you have all the source code for that device then you
could build your own eng build.  And if there is a way to reflash the
firmware on the fancy new device you could install your own eng build
on it.  Otherwise you would probably need to contact BrandNew Co.

Mike

2009/5/20 alanchen :
>
> Hi Mike,
>
> Suppose there's a new fancy device made by BrandNew Co. and it's
> equipped with a new hardware component and its driver.
>
> Now I wish to develop a new fancy application to utilize the new
> hardware feature, the only way to retrieve the "eng" build is to
> contact the BrandNew Co ?
>
> Alan
>
> On 5月14日, 下午8時30分, Mike Lockwood  wrote:
>> FYI - there are three types of builds that have varying levels of security:
>>
>> "user" builds are secure. there is no way to get root access to the
>> phone (unless you count the keyboard console bug that was fixed in
>> RC30).  This is what ships for regular customers.
>>
>> "eng" builds are insecure - adb runs as root user, which allows you to
>> get access to files within the /data partition, remount the /system
>> file system read/write, etc.  The eng builds are normally used for
>> development, so it is easier to debug and replace system files with
>> "adb remount" and "adb sync"
>>
>> "userdebug" builds are somewhere in between.  The purpose is to run as
>> close as possible to a user build while still allowing access for
>> debugging.  adb runs as non-root, but the "su" command is enabled so
>> you can get a root shell.  And new in cupcake is the "adb root"
>> command, which restarts adb as root user, which basically allows you
>> to enable the adb commands that work in the "eng" build.
>>
>> eng and userdebug builds also have some extra features enabled not in
>> user builds, like the ability to attach to any Java process with DDMS
>> or a Java debugger and saving bugreport files to the SD card by
>> pressing a key combination.
>>
>> Based on what you are saying (the fact that "adb root" works), it
>> sounds like HTC has a userdebug build on their web site.
>>
>> Mike
>>
> >
>



-- 
Mike Lockwood
Google android team

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: adb remount fails on G1 with Android 1.5 images

2009-05-14 Thread Mike Lockwood

FYI - there are three types of builds that have varying levels of security:

"user" builds are secure. there is no way to get root access to the
phone (unless you count the keyboard console bug that was fixed in
RC30).  This is what ships for regular customers.

"eng" builds are insecure - adb runs as root user, which allows you to
get access to files within the /data partition, remount the /system
file system read/write, etc.  The eng builds are normally used for
development, so it is easier to debug and replace system files with
"adb remount" and "adb sync"

"userdebug" builds are somewhere in between.  The purpose is to run as
close as possible to a user build while still allowing access for
debugging.  adb runs as non-root, but the "su" command is enabled so
you can get a root shell.  And new in cupcake is the "adb root"
command, which restarts adb as root user, which basically allows you
to enable the adb commands that work in the "eng" build.

eng and userdebug builds also have some extra features enabled not in
user builds, like the ability to attach to any Java process with DDMS
or a Java debugger and saving bugreport files to the SD card by
pressing a key combination.

Based on what you are saying (the fact that "adb root" works), it
sounds like HTC has a userdebug build on their web site.

Mike

On Thu, May 14, 2009 at 2:00 AM, KG  wrote:
>
> I have figured out a way to do this...
>
> First run "adb root" this will give you root access to G1's file
> system, then you can execute commands like adb push, adb pull etc
>
> --kartic
>
> On May 13, 6:19 pm, Kartic  wrote:
>> Hi All,
>>
>> I have upgraded my phone's images to Android 1.5 images 
>> (fromhttp://www.htc.com/www/support/android/adp.html)
>> Now when I try commands like adb remount, chmod, adb push etc I get
>> "Operation not permitted" and "Permission denied" errors
>>
>> I was able to give this command when I had 1.0 images flashed on my
>> phone.
>> I used to do this to push native so files to the device and other data
>> files which are needed by my app.
>>
>> Has something related to permissions changed with Android 1.5?
>>
>> Regards,
>> Kartic
> >
>



-- 
Mike Lockwood
Google android team

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: getNeighboringCellInfo()

2009-04-30 Thread Mike Lockwood

Are you taking internal code from the telephony package and linking it
directly in your application?  If so, that will probably not work
because your application does not have the necessary permissions
required for accessing the telephony system.

Mike

On Thu, Apr 30, 2009 at 7:48 PM, alexdonnini  wrote:
>
> Hello,
>
> Thanks for the response.
>
> In my application's source folder, I do have a
> com.android.internal.telephony
> package containing the necessary modules:
> IPhoneStateListener.aidl
> IPhoneSubInfo.aidl
> ITelephony.aidl
> ITelephonyRegistry.aidl
> IPhoneStateListener.java
> IPhoneSubInfo.java
> ITelephony.java
> ITelephonyRegistry.java
>
> In the copy of TelephonyManager I use, I have the following import
> statements (as expected, without them TelephonyManager reports an
> error):
> import com.android.internal.telephony.IPhoneStateListener;
> import com.android.internal.telephony.IPhoneSubInfo;
> import com.android.internal.telephony.ITelephony;
> import com.android.internal.telephony.ITelephonyRegistry;
>
> I have also made sure that the standard
> com.android.internal.telephony
> be not included in the library referenced by the application
> (otherwise it does not build)
>
> Except for the (failed) attempt to use getNeighboringCellInfo(), the
> application works without problems. All calls to the copy of
> TelephonyManager I use work.
>
> If, as you say, the application cannot find getNeighboringCellInfo(),
> wouldn't the same problem occur with other TelephonyManager functions?
>
> Thanks for your help.
>
> Alex Donnini
> On Apr 30, 5:03 pm, fadden  wrote:
>> On Apr 29, 8:54 pm, alexdonnini  wrote:
>>
>> > Could someone please explain to me why the public
>> > getNeighboringCellInfo() method in TelephonyManager.java causes my
>> > application to crash (see error log below)?
>> [...]
>> > 04-29 23:46:05.754: WARN/dalvikvm(5854): VFY: unable to resolve
>> > interface method 23808: Lcom/android/internal/telephony/
>> > ITelephony;.getNeighboringCellInfo ()Ljava/util/List;
>> > 04-29 23:46:05.754: WARN/dalvikvm(5854): VFY:  rejecting opcode 0x72
>> > at 0x0004
>> > 04-29 23:46:05.754: WARN/dalvikvm(5854): VFY:  rejected Lcom/android/
>> > locationtest/TelephonyManager;.getNeighboringCellInfo ()Ljava/util/
>> > List;
>> > 04-29 23:46:05.754: WARN/dalvikvm(5854): Verifier rejected class Lcom/
>> > android/locationtest/TelephonyManager;
>>
>> com.android.locationtest.TelephonyManager.getNeighboringCellInfo tried
>> to use
>> com.android.internal.telephony.ITelephony.getNeighboringCellInfo, but
>> couldn't find it.
>>
>> Normally the call to the "internal" package happens from
>> com.android.telephony.TelephonyManager.getNeighboringCellInfo.
>>
>> Is the "locationtest" package yours?  Is there some weird class loader
>> stuff going on?
> >
>



-- 
Mike Lockwood
Google android team

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: Phone.java phone location management

2009-04-15 Thread Mike Lockwood

Yes, the LocationManager would be the proper way to get the
information you are asking for.  It is the public API for location
services and already handles the IPC and permissions checking
necessary for transferring this information from the phone process to
an application.  Unfortunately it currently does not provide the
detailed cell location information you are asking for.

We could add the extra cell location information to the Bundle object
returned via the LocationListener.onStatusChanged() callback.  If you
could make a proposal of the information that should be included we
could try to add it in a future release.

Mike

On Wed, Apr 15, 2009 at 12:37 AM, Dianne Hackborn  wrote:
> A lot of the telephony classes you'll see in the framework will only work in
> the phone process, because they do not have any IPC abstraction behind
> them.  There is also significant work taking place on them, such as to
> support CDMA, that we have been fairly conservative about what is exposed to
> avoid having to break APIs.  The official APIs you can use are
> TelephonyManager, for for location stuff you generally should be using
> LocationManager.
>
> On Tue, Apr 14, 2009 at 7:51 PM, alexdonnini  wrote:
>>
>> Hello,
>>
>> As I understand it, the Phone.java interface is not available to
>> application developers. This being the case (please confirm), how can
>> application developers access detailed phone related data such as
>> neighboring CID (refer to the Phone.java code for additional
>> information)?
>>
>> Retrieving this kind of information depends on the instantiation of
>> Phone (e.g. via makeDefaultPhone, or getDefaultPhones.
>> makeDefaultPhone cannot be used without special permission.
>>
>> It looks to me like somehow, for reasons I do not quite understand, it
>> is particularly difficult to access and manage phone location
>> information (e.g. have direct access to the Phone.java interface).
>>
>> Why is that? It cannot be a matter of security as testing of a
>> function and development of an application does not automatically
>> translate into publishing and approval of that application.
>>
>> I would appreciate anyone's feedback and help on this.
>>
>> Thanks.
>>
>> Alex Donnini
>>
>>
>
>
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
>
>
> >
>



-- 
Mike Lockwood
Google android team

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: CONTROL_LOCATION_UPDATES permission failure

2009-04-09 Thread Mike Lockwood

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

Mike

On Thu, Apr 9, 2009 at 2:17 PM, alexdonnini  wrote:
>
> Hello,
>
> Although the manifest file in my application contains
>
>  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
> >
>



-- 
Mike Lockwood
Google android team

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: Framework: does Android support USB devices?

2009-03-14 Thread Mike Lockwood

On Fri, Mar 13, 2009 at 3:00 AM, Will  wrote:
>
> Does the Android framework support USB devices, like Phidgets? Can an
> app take a stream of data from a phidget?

I'm not sure what a Phidget is, but currently there are no Java APIs
for dealing with USB at the moment.  We only have built-in support for
USB mass storage and ADB.

If you can give us a better idea of what you are trying to do, we will
be able to consider it as a feature request.

Mike

-- 
Mike Lockwood
Google android team

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: How to test GPS

2009-01-15 Thread Mike Lockwood

The /etc/gps.conf file on G1 looks like:

NTP_SERVER=north-america.pool.ntp.org
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin

NTP_SERVER is used to specify an NTP server for time injection.  The
XTRA_SERVER_* entries are for a Qualcomm specific feature.  All these
are optional - the GPS should be able to function without the gps.conf
file.  (So that message should really be a warning, not an error I
guess...)

Mike

On Thu, Jan 15, 2009 at 3:56 AM, John Cola  wrote:
>
> Hi all
> I am willing to test GPS on my device.
> However, in my first step of emulating the GPS behavior on my device,
> I encounter with the problem of
> "Could not open GPS configuration file /etc/gps.conf"
>
> Can anyone provide some information about it?
>
> BR
> John
> >
>



-- 
Mike Lockwood
Google android team

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: SD Card ID

2009-01-08 Thread Mike Lockwood

Yes, it uses the mount point, so that would be /sdcard on android.
However, Java code should use
android.os.Environment.getExternalStorageDirectory() to avoid hard
coding the path name.

Mike

On Thu, Jan 8, 2009 at 8:54 PM, cturner  wrote:
>
> Thanks.  I see this code.
>
>#ifdef VFAT_IOCTL_GET_VOLUME_ID
>int fd = open(pathStr, O_RDONLY);
>if (fd >= 0) {
>result = ioctl(fd, VFAT_IOCTL_GET_VOLUME_ID);
>close(fd);
>}
>#endif
>
> Would I use "/sdcard" as the pathStr?
>
> On Jan 8, 4:45 pm, "Mike Lockwood"  wrote:
>> Yes, you can get that from android.os.FileUtils.getFatVolumeId().  The
>> native code for this is in android_os_FileUtils.cpp
>>
>> But the FileUtils API is not public so this not accessible from apps
>> built with the SDK.  It also requires a kernel change that is not in
>> the mainline Linux kernel, so if you are porting to another platform
>> you will need to pull that code into your kernel.
>>
>> Mike
>>
>> On Thu, Jan 8, 2009 at 6:53 PM, cturner  wrote:
>>
>> > How do I read the unique ID of the SD card?  Is there a native or Java
>> > API available to do this?
>>
>> --
>> Mike Lockwood
>> Google android team
> >
>



-- 
Mike Lockwood
Google android team

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: SD Card ID

2009-01-08 Thread Mike Lockwood

Yes, you can get that from android.os.FileUtils.getFatVolumeId().  The
native code for this is in android_os_FileUtils.cpp

But the FileUtils API is not public so this not accessible from apps
built with the SDK.  It also requires a kernel change that is not in
the mainline Linux kernel, so if you are porting to another platform
you will need to pull that code into your kernel.

Mike

On Thu, Jan 8, 2009 at 6:53 PM, cturner  wrote:
>
> How do I read the unique ID of the SD card?  Is there a native or Java
> API available to do this?
> >
>



-- 
Mike Lockwood
Google android team

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---



Re: Would the second partition on SD card be mounted and used?

2008-12-16 Thread Mike Lockwood

Hi Brian,

mountd has not been tested with multiple partitions on the same card
so there is a chance some small fixes might be necessary.  But
theoretically it should work if you specify the correct block devices
and mount points in mountd.conf.

The bigger issue is the higher level framework does not provide any
support for multiple external storage devices at present.

Mike

On Tue, Dec 16, 2008 at 6:32 AM, Brian  wrote:
>
> Hi,
> Having checked system/core/mountd/AutoMount.c, it seems that
> partitions on SD card could be all mounted if there are mount points
> created in /system/etc/mount.conf.
> Am I right?
> How is the framework designed to work with the second partition on SD
> card?


-- 
Mike Lockwood
Google android team

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~--~~~~--~~--~--~---