Merge tag 'AU_LINUX_ANDROID_KK.04.04.04.010.073' into HEAD

AU_LINUX_ANDROID_KK.04.04.04.010.073 based on quic/aosp/kk

Change-Id: I71052e752e71e9c81e1980b3c11862ab587d3360
diff --git a/Android.mk b/Android.mk
index 4cfaa31..7c498da 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,6 +1,4 @@
-ifneq (, $(filter aarch64 arm64, $(TARGET_ARCH)))
-    $(info TODOAArch64: $(LOCAL_PATH)/Android.mk: Enable build support for 64 bit)
-else
+ifeq ($(BOARD_HAVE_QCOM_FM),true)
 ifneq (,$(filter $(QCOM_BOARD_PLATFORMS),$(TARGET_BOARD_PLATFORM)))
 LOCAL_PATH:= $(call my-dir)
 LOCAL_DIR_PATH:= $(call my-dir)
@@ -21,4 +19,4 @@
 LOCAL_PATH := $(LOCAL_DIR_PATH)
 include $(LOCAL_PATH)/FMRecord/Android.mk
 endif # is-vendor-board-platform
-endif # TARGET_ARCH
+endif # BOARD_HAVE_QCOM_FM
diff --git a/FMRecord/Android.mk b/FMRecord/Android.mk
index 647b941..b248bc3 100644
--- a/FMRecord/Android.mk
+++ b/FMRecord/Android.mk
@@ -1,3 +1,4 @@
+ifeq ($(BOARD_HAVE_QCOM_FM),true)
 ifneq (,$(filter $(QCOM_BOARD_PLATFORMS),$(TARGET_BOARD_PLATFORM)))
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
@@ -10,5 +11,5 @@
 LOCAL_CERTIFICATE := platform
 LOCAL_PROGUARD_ENABLED := disabled
 include $(BUILD_PACKAGE)
-
 endif
+endif # BOARD_HAVE_QCOM_FM
diff --git a/fmapp2/res/layout-800x480/fmradio.xml b/fmapp2/res/layout-800x480/fmradio.xml
index e209769..0b96bc5 100644
--- a/fmapp2/res/layout-800x480/fmradio.xml
+++ b/fmapp2/res/layout-800x480/fmradio.xml
@@ -56,6 +56,7 @@
             android:drawableLeft="@drawable/count_down"
             android:layout_toRightOf="@+id/btn_onoff"
             android:textSize="14sp"
+            android:textColor="@android:color/white"
             android:layout_marginLeft="5dp"
             android:textStyle="bold"
             android:visibility="invisible"
@@ -71,6 +72,7 @@
             android:layout_toLeftOf="@+id/btn_silent"
             android:layout_toRightOf="@+id/sleep_msg_tv"
             android:textSize="16sp"
+            android:textColor="@android:color/white"
             android:singleLine="true"
             android:textStyle="bold"
             android:text="@string/prog_service_string"/>
diff --git a/fmapp2/res/layout-800x480/station_info.xml b/fmapp2/res/layout-800x480/station_info.xml
index 87a8f7e..c96775a 100644
--- a/fmapp2/res/layout-800x480/station_info.xml
+++ b/fmapp2/res/layout-800x480/station_info.xml
@@ -56,6 +56,7 @@
                 android:layout_marginLeft="20dp"
                 android:textSize="14sp"
                 android:textStyle="bold"
+                android:textColor="@android:color/white"
                 android:clickable="true"
                 android:visibility="invisible"
                 android:text="@string/default_record"/>
@@ -70,6 +71,7 @@
                 android:layout_alignParentRight="true"
                 android:layout_alignBaseline="@id/signal_level"
                 android:textSize="13sp"
+                android:textColor="@android:color/white"
                 android:text="@string/default_audio"/>
 
         </RelativeLayout>
@@ -88,6 +90,7 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:textSize="14sp"
+                android:textColor="@android:color/white"
                 android:paddingTop="2dp"
                 android:paddingRight="2dp"
                 android:paddingBottom="2dp"
@@ -99,6 +102,7 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:textSize="14sp"
+                android:textColor="@android:color/white"
                 android:paddingTop="2dp"
                 android:paddingRight="2dp"
                 android:paddingBottom="2dp"
@@ -120,6 +124,7 @@
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:textSize="25dp"
+                     android:textColor="@android:color/white"
                      android:gravity="center"
                      android:clickable="true"
                      android:focusable="true"
@@ -160,6 +165,7 @@
             android:textSize="15sp"
             android:singleLine="true"
             android:textStyle="bold"
+            android:textColor="@android:color/white"
             android:paddingLeft="2dp"
             android:paddingRight="2dp"
             android:paddingBottom="5dp"
@@ -172,6 +178,7 @@
             android:layout_height="wrap_content"
             android:textAppearance="?android:attr/textAppearanceMedium"
             android:textSize="15sp"
+            android:textColor="@android:color/white"
             android:singleLine="true"
             android:textStyle="bold"
             android:paddingLeft="2dp"
diff --git a/fmapp2/res/layout/statusbar.xml b/fmapp2/res/layout/statusbar.xml
index 677ed74..47e1a91 100644
--- a/fmapp2/res/layout/statusbar.xml
+++ b/fmapp2/res/layout/statusbar.xml
@@ -45,7 +45,7 @@
 
     <TextView android:id="@+id/frequency"
         android:textAppearance="?android:attr/textAppearanceMediumInverse"
-        android:textColor="#FFFFFFFF"
+        android:textColor="@android:color/black"
         android:focusable="true"
         android:ellipsize="marquee"
         android:singleLine="true"
diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java
index f4ed775..15f16ce 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadio.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadio.java
@@ -96,6 +96,7 @@
 import com.caf.fmradio.HorizontalNumberPicker.Scale;
 
 import android.content.SharedPreferences;
+import android.graphics.Color;
 
 public class FMRadio extends Activity
 {
@@ -1870,6 +1871,11 @@
          }else {
             setRecordingStartImage();
          }
+         for (int nButton = 0; nButton < MAX_PRESETS_PER_PAGE; nButton++) {
+             if (mPresetButtons[nButton] != null) {
+                  mPresetButtons[nButton].setTextColor(Color.WHITE);
+             }
+        }
       }else {
          if (mRadioTextScroller != null) {
              mRadioTextScroller.stopScroll();
@@ -1877,6 +1883,11 @@
          if (mERadioTextScroller != null) {
              mERadioTextScroller.stopScroll();
          }
+         for (int nButton = 0; nButton < MAX_PRESETS_PER_PAGE; nButton++) {
+             if (mPresetButtons[nButton] != null) {
+                  mPresetButtons[nButton].setTextColor(Color.BLACK);
+             }
+         }
       }
       if (mForwardButton != null) {
           mForwardButton.setVisibility(((bEnable == true) ? View.VISIBLE
diff --git a/fmapp2/src/com/caf/fmradio/FMTransmitterService.java b/fmapp2/src/com/caf/fmradio/FMTransmitterService.java
index e79ee8b..980c968 100644
--- a/fmapp2/src/com/caf/fmradio/FMTransmitterService.java
+++ b/fmapp2/src/com/caf/fmradio/FMTransmitterService.java
@@ -1163,22 +1163,6 @@
         @Override
         public void setEnabled(boolean enabled) {
         }
-
-        @Override
-        public void updateFolderInfoBrowsedPlayer(String stringUri) {
-        }
-
-        @Override
-        public void updateNowPlayingContentChange() {
-        }
-
-        @Override
-        public void playItemResponse(boolean success) {
-        }
-
-        @Override
-        public void updateNowPlayingEntries(long[] playList) {
-        }
    }
 
    class Metadata {
diff --git a/fmapp2/src/com/caf/hc_utils/FrequencyPicker.java b/fmapp2/src/com/caf/hc_utils/FrequencyPicker.java
index c88bb0a..466cc0e 100644
--- a/fmapp2/src/com/caf/hc_utils/FrequencyPicker.java
+++ b/fmapp2/src/com/caf/hc_utils/FrequencyPicker.java
@@ -32,7 +32,7 @@
 import com.caf.fmradio.R;
 import android.widget.NumberPicker;
 import android.widget.NumberPicker.OnValueChangeListener;
-
+import android.graphics.Color;
 /**
  * A view for selecting the frequency
  *
@@ -86,6 +86,7 @@
         mMHzPicker = (NumberPicker) findViewById(R.id.mhz);
         if (mMHzPicker != null) {
            mMHzPicker.setOnLongPressUpdateInterval(100);
+           mMHzPicker.setBackgroundColor(Color.WHITE);
 
            mMHzPicker.setOnValueChangedListener(new OnValueChangeListener() {
               public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
@@ -101,6 +102,7 @@
         mKHzPicker = (NumberPicker) findViewById(R.id.khz);
         if (mKHzPicker != null) {
            mKHzPicker.setOnLongPressUpdateInterval(100);
+           mKHzPicker.setBackgroundColor(Color.WHITE);
            mKHzPicker.setOnValueChangedListener(new OnValueChangeListener() {
               public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
                   mKhz = newVal;
diff --git a/jni/Android.mk b/jni/Android.mk
index d253498..5bc46d3 100644
--- a/jni/Android.mk
+++ b/jni/Android.mk
@@ -1,3 +1,4 @@
+ifeq ($(BOARD_HAVE_QCOM_FM),true)
 ifneq (,$(filter $(QCOM_BOARD_PLATFORMS),$(TARGET_BOARD_PLATFORM)))
 LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
@@ -16,12 +17,9 @@
 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
 LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
 
-LOCAL_CFLAGS += -include bionic/libc/kernel/common/linux/types.h
-LOCAL_CFLAGS += -include bionic/libc/kernel/common/linux/posix_types.h
-LOCAL_CFLAGS += -include bionic/libc/kernel/common/linux/socket.h
-
 LOCAL_MODULE := libqcomfm_jni
 LOCAL_MODULE_TAGS := optional
 
 include $(BUILD_SHARED_LIBRARY)
 endif # is-vendor-board-platform
+endif # BOARD_HAVE_QCOM_FM
diff --git a/jni/android_hardware_fm.cpp b/jni/android_hardware_fm.cpp
index b2b0814..8d2e610 100644
--- a/jni/android_hardware_fm.cpp
+++ b/jni/android_hardware_fm.cpp
@@ -445,22 +445,22 @@
 
 /* native interface */
 static jint android_hardware_fmradio_FmReceiverJNI_getBufferNative
- (JNIEnv * env, jobject thiz, jint fd, jbooleanArray buff, jint index)
+ (JNIEnv * env, jobject thiz, jint fd, jbyteArray buff, jint index)
 {
     int err;
     jboolean isCopy;
-    jboolean *bool_buffer;
+    jbyte *byte_buffer;
 
     if ((fd >= 0) && (index >= 0)) {
-        bool_buffer = env->GetBooleanArrayElements(buff, &isCopy);
+        byte_buffer = env->GetByteArrayElements(buff, &isCopy);
         err = FmIoctlsInterface :: get_buffer(fd,
-                                               (char *)bool_buffer,
+                                               (char *)byte_buffer,
                                                STD_BUF_SIZE,
                                                index);
         if (err < 0) {
             err = FM_JNI_FAILURE;
         }
-        env->ReleaseBooleanArrayElements(buff, bool_buffer, 0);
+        env->ReleaseByteArrayElements(buff, byte_buffer, 0);
     } else {
         err = FM_JNI_FAILURE;
     }