fmradio: Add an optional static library target

FMRadio is not exposed as a framework functionality and this makes it
harder to expose it to some use cases such as testing.

This patch turns the non-ui components of the app into a static library
that can be linked by other apps.

Change-Id: Ifafd105461303cbaea5f1e788e1c0af95ad894c9
diff --git a/Android.mk b/Android.mk
index cf84236..1fc1a34 100644
--- a/Android.mk
+++ b/Android.mk
@@ -15,6 +15,12 @@
 LOCAL_PATH:= $(call my-dir)
 
 include $(CLEAR_VARS)
+LOCAL_MODULE := FMRadio_static
+LOCAL_SRC_FILES := $(filter-out src/com/android/fmradio/%Activity.java src/com/android/fmradio/dialogs/% src/com/android/fmradio/views/%, $(call all-java-files-under, src))
+LOCAL_RESOURCE_DIR = $(LOCAL_PATH)/res
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+include $(CLEAR_VARS)
 
 LOCAL_MODULE_TAGS := optional
 LOCAL_CERTIFICATE := platform
diff --git a/src/com/android/fmradio/FmService.java b/src/com/android/fmradio/FmService.java
index d5297a5..c53ebb0 100644
--- a/src/com/android/fmradio/FmService.java
+++ b/src/com/android/fmradio/FmService.java
@@ -134,7 +134,7 @@
     // RT String
     private String mRtTextString = "";
     // Notification target class name
-    private String mTargetClassName = FmMainActivity.class.getName();
+    private String mTargetClassName = "com.android.fmradio.FmMainActivity";
     // RDS thread use to receive the information send by station
     private Thread mRdsThread = null;
     // record whether RDS thread exit