title: Can't import "android.os.AsyncResult" in built app within AOSP
body: <p>I'm trying to compile an app via AOSP in build time. It uses the class <code>android.os.AsyncResult</code>. Whenever I try to make project, it stops with an error</p>
  
  <pre><code>packages/apps/MyPackage/src/MyCompany/MyClass.java:[lineNumber]: error: cannot find symbol import android.os.AsyncResult;
  </code></pre>
  
  <p>What I've done so far:</p>
  
  <ol>
  <li>I properly added the package in AOSP tree, including its name in core.mk;</li>
  <li>Package is successfully built by just removing AsyncResult class import from app source. That's causing the error during build indeed.</li>
  <li>I've configured this package to be a platform one.</li>
  </ol>
  
  <p>My Android.mk is as follow:</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  include $(CLEAR_VARS)
  LOCAL_JAVA_LIBRARIES := telephony-common
  appcompat_dir := ../../../prebuilts/sdk/current/support/v7/appcompat/res
  gridlayout_dir := ../../../prebuilts/sdk/current/support/v7/gridlayout/res
  res_dir := res $(appcompat_dir) $(gridlayout_dir)
  LOCAL_MODULE_TAGS := optional
  LOCAL_SRC_FILES := $(call all-java-files-under, src)
  LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dir))
  LOCAL_AAPT_FLAGS := --auto-add-overlay
  LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.appcompat:android.support.v7.gridlayout
  LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4
  LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat
  LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-gridlayout
  LOCAL_PACKAGE_NAME := MyPackage
  LOCAL_CERTIFICATE := platform
  LOCAL_PRIVILEGED_MODULE := true
  LOCAL_SDK_VERSION := current
  include $(BUILD_PACKAGE)
  </code></pre>
  
  <p>I suspect that apps in packages/apps can't find sources from <code>frameworks/base/core/java/...</code> automatically. But also this makes no sense, as some applications (i.e. Settings) located in packages/apps can be compiled without error using classes from <code>frameworks/base/core/java/...</code></p>
  
  <p>I'm somewhat lost here. Can someone point me a hint on how to solve this symbol missing?</p>