opening up Android API to allow invocation of privileged classes

330 views
Skip to first unread message

dreamerBoy

unread,
Dec 12, 2008, 7:30:38 PM12/12/08
to Android Linux Kernel Development
I am doing some work for a major telecomm manufacturer.

We have come to the conclusion that to properly exercise the device
and software implementation, we need access to privileged Android
classes such as:

com.android.internal.telephony.Phone,
com.android.internal.telephony.Call

etc.

Currently, it is not possible to invoke functions on these classes
because they are package-private in the Android "OS". However, it
would not be that difficult to alter these classes so that they are
publicly visibile, to whit:

old Call.java:
~~

package com.android.internal.telephony;
...

class Call
{
...
void hangup() { ...}
...
}
~~

new Call.java
~~

package com.android.internal.telephony;

public class Call
{
...
public void hangup() { ...}
...
}
~~

Has anyone embarked on such a program? (When I attempted to run the
0.9 android.jar in the emulator, my operation was failed and a message
came up indicating that it knew I was trying to invoke my own build ..
and warned that further problems lay ahead. I don't expect
necessarily that this custom build would be usable inside the
emulator; test applications using it would have to be tested directly
on the phone.)

The problem is that the public API is just not rich enough to allow
comprehensive testing.

Thanks for your thoughts.



Henrique Almeida

unread,
Dec 12, 2008, 7:45:39 PM12/12/08
to android...@googlegroups.com

 You can get the full SDK source from source.android.com and regenerate it, with your changes.

2008/12/12 dreamerBoy <Paul.H...@gmail.com>



--
Henrique Dante de Almeida
hda...@gmail.com

Jean-Baptiste Queru

unread,
Dec 12, 2008, 7:53:36 PM12/12/08
to android...@googlegroups.com
Thanks for moving this discussion onto the android-platform list (or
even straight into android-framework, since it's about changing
SDK-visible behaviors).

JBQ

Joe Onorato

unread,
Dec 12, 2008, 10:12:40 PM12/12/08
to android...@googlegroups.com
It is possible to use private APIs if and only if the app you're trying to write ships on a device.  The way to build those is to download the source, following the instructions and source.android.com, and build directly against the source instead of using the SDK.  In general, we don't recommend this, because the internal functions are likely to change between releases, making more maintenance work for you; but it is possible.

-joe
Reply all
Reply to author
Forward
0 new messages