0

The ContentResolver class has a hidden method called getSyncStatus(...).

To make it public visible I try to add a wrapper method in ContentResolverCompat from support v4 lib.

This works so far in Eclipse but when I call make it fails with the following errors:

ERROR: /development/android/frameworks/support/v4/java/android/support/v4/content/SyncStatusInfo.java:91: android.content.SyncStatusInfo cannot be resolved to a type
ERROR: /development/android/frameworks/support/v4/java/android/support/v4/content/ContentResolverCompat.java:19: The import android.accounts cannot be resolved
ERROR: /development/android/frameworks/support/v4/java/android/support/v4/content/ContentResolverCompat.java:137: Account cannot be resolved to a type
ERROR: /development/android/frameworks/support/v4/java/android/support/v4/content/ContentResolverCompat.java:138: android.content.SyncStatusInfo cannot be resolved to a type
ERROR: /development/android/frameworks/support/v4/java/android/support/v4/content/ContentResolverCompat.java:146: Account cannot be resolved to a type
ERROR: /development/android/frameworks/support/v4/java/android/support/v4/content/ContentResolverCompat.java:148: android.content.SyncStatusInfo cannot be resolved to a type 

My thought was that @hide is a documentation thing only and I can access it from within AOSP classes. But why I can't build my changes when I want to access hidden classes / methods?

Note: I don't want to build an Android app, I want to change / build the Android source code itself.

Edit: This isn't a duplicate of @hide class not found because @hide means that it is removed from JavaDoc but it is still accessible from Android source code itself.

Community
  • 1
  • 1
Ralph Bergmann
  • 3,015
  • 4
  • 30
  • 61
  • IIRC, `@hide` methods are not declared in the *interfaces* you usually deal with, and the implementations are usually not available at compile time, i.e. they're not part of the SDK. – JimmyB Apr 26 '16 at 10:37
  • MikeM. from you link _The @ hide attribute is just part of javadoc(droiddoc also), so the @ hide just simply mean the method/class/field is excluded from the API docs._ This means that it is still accessible from Android source code itself? So why I can't use it? – Ralph Bergmann Apr 26 '16 at 10:44
  • @ hide is both for javadoc and for making a `android.jar` located in `/platforms/android-*/android.jar` – pskink Apr 26 '16 at 11:13
  • Read more at https://github.com/anggrayudi/android-hidden-api – Pankaj Kumar Apr 26 '16 at 11:34
  • @PankajKumar I think I asked the wrong question :-( I don't want to build an Android app. Instead I want to change the Android source itself to push it to AOSP. At the end I want to change one internal class to access another internal class. – Ralph Bergmann Apr 26 '16 at 11:58
  • Can you tell me the classes where you want to make changes and what changes. – Pankaj Kumar Apr 26 '16 at 14:07
  • @PankajKumar I want to add a method in `ContentResolverCompat.java`[1] where I want to access `getSyncStatus(...)`[2] in `ContentResolver.java` [1] ... https://android.googlesource.com/platform/frameworks/support/+/refs/heads/master/v4/java/android/support/v4/content/ContentResolverCompat.java [2] ... https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/java/android/content/ContentResolver.java#2332 – Ralph Bergmann Apr 26 '16 at 14:34

0 Answers0