Android Project realizes phone auto-hang function

Source: Internet
Author: User

  private void Endcall () {
try {
/*
* 1. Get bytecode files
* 2. Get the corresponding method GetService
* 4. Implement this method
* Above is the reflection process
* 5. Copy aidl file
* 6. Generate Java Code
* 7, execute endcall ();
*/
Class clazz = BlackNumberService.class.getClassLoader ()
. LoadClass ("Android.os.ServiceManager");
method = Clazz.getdeclaredmethod ("GetService",
String.class);
IBinder IBinder = (ibinder) method.invoke (NULL,
Telephony_service);
ITelephony.Stub.asInterface (IBinder). Endcall ();

} catch (Exception e) {
TODO auto-generated Catch block
E.printstacktrace ();
}
}

For more detailed connections:

Http://www.2cto.com/kf/201412/356965.html

Android Project realizes phone auto-hang function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.