Let's say there is an Android library class that does not have a feature that I want, and so I just want to cut and paste the class into my project as a new class file and add the feature myself.
I have a specific case where I wanted to do this with the TextToSpeech
class, but after I cut and pasted the code, there are lots of missing (grey) imports, (these are "annotations" and a couple of other classes that do not seem to allow the normal importing behavior when pressing option-enter).
Sorry. If the class depends on other APIs residing in the framework (not the public API), i.e. imports them, you can't do this.
The only option you have is to change the class within AOSP and build an Android image. Unfortunately, in this case you're going to be the only user of the updated APIs :(