1

Normally, you can't direcly call Android APIs that are hidden (with the @hide annotation) from an app. You must use reflection to call such a method.

But some of the apps that are included in AOSP call hidden methods directly. How can I do this too for an app I add to the AOSP build tree?

Android09
  • 31
  • 2
  • These methods are hidden for a reason. You should not call them at all. – Henry Jan 30 '18 at 07:43
  • 1
    They were build with modified Android source code, which does not `hide` anything. You can investigate in that direction, and get the modified `android.jar` (or something like that) as well. Then you will be able to use hidden methods too. – Vladyslav Matviienko Jan 30 '18 at 08:50

1 Answers1

2

An app inside the AOSP build tree can call hidden methods if you comment out the following line in Android.mk:

LOCAL_SDK_VERSION := current

Android09
  • 31
  • 2