QtiSoundRecorder: convert the mk to bp

1. upgrade the v4/v7 support library to androidx
2. convert the mk to bp

Change-Id: Ibd9150274412c9358cb7b6ff37817b7d29f04d52
CRs-Fixed: 2560221
diff --git a/Android.bp b/Android.bp
new file mode 100755
index 0000000..00eb136
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,39 @@
+// make wrapper static lib
+java_library {
+    name: "qti_soundrecorder_wrapper",
+    srcs: ["src-Wrapper/**/*.java"],
+
+    // support access hidden APIs
+    platform_apis: true,
+
+}
+
+android_app {
+    name: "QtiSoundRecorder",
+
+    srcs: ["**/*.java"],
+
+    resource_dirs: ["res"],
+
+    aaptflags: ["--auto-add-overlay"] + ["--extra-packages"] + ["androidx.recyclerview_recyclerview"],
+
+
+    static_libs: [
+        "androidx.recyclerview_recyclerview",
+        "androidx.core_core",
+        "qti_soundrecorder_wrapper",
+    ],
+
+    overrides: ["SoundRecorder"],
+
+    // support access hidden APIs
+    platform_apis: true,
+
+    optimize: {
+        proguard_flags_files: ["proguard.flags"],
+    },
+
+    privileged: true,
+
+}
+
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index eb481b7..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-ifeq ($(TARGET_FWK_SUPPORTS_FULL_VALUEADDS),true)
-LOCAL_PATH:= $(call my-dir)
-
-# make wrapper static lib
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(call all-java-files-under, src-Wrapper)
-LOCAL_MODULE := qti_soundrecorder_wrapper
-LOCAL_MODULE_TAGS := optional
-
-# support access hidden APIs
-LOCAL_PRIVATE_PLATFORM_APIS:=true
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
-LOCAL_RESOURCE_DIR += frameworks/support/v7/recyclerview/res
-
-LOCAL_AAPT_FLAGS += --auto-add-overlay
-LOCAL_AAPT_FLAGS += --extra-packages
-LOCAL_AAPT_FLAGS += android.support.v7.recyclerview
-
-LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4
-LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-recyclerview
-LOCAL_STATIC_JAVA_LIBRARIES += qti_soundrecorder_wrapper
-
-LOCAL_PACKAGE_NAME := QtiSoundRecorder
-LOCAL_OVERRIDES_PACKAGES := SoundRecorder
-
-# support access hidden APIs
-LOCAL_PRIVATE_PLATFORM_APIS:=true
-
-LOCAL_PROGUARD_FLAG_FILES := proguard.flags
-
-LOCAL_PRIVILEGED_MODULE := true
-
-include $(BUILD_PACKAGE)
-endif#TARGET_FWK_SUPPORTS_FULL_VALUEADDS
\ No newline at end of file
diff --git a/app_qtiSoundRecorder_system_product.mk b/app_qtiSoundRecorder_system_product.mk
old mode 100644
new mode 100755
index ff54b75..0d0ee6a
--- a/app_qtiSoundRecorder_system_product.mk
+++ b/app_qtiSoundRecorder_system_product.mk
@@ -1,2 +1,4 @@
+ifeq ($(TARGET_FWK_SUPPORTS_FULL_VALUEADDS),true)
 PRODUCT_PACKAGES += \
-    QtiSoundRecorder
\ No newline at end of file
+    QtiSoundRecorder
+endif
\ No newline at end of file
diff --git a/proguard.flags b/proguard.flags
old mode 100644
new mode 100755
index eac5d6e..c319580
--- a/proguard.flags
+++ b/proguard.flags
@@ -1,2 +1,2 @@
 #Avoid the library class dependency error
--dontwarn android.support.v7.recyclerview.*
\ No newline at end of file
+-keep class androidx.core.app.CoreComponentFactory
\ No newline at end of file
diff --git a/src/com/android/soundrecorder/filelist/FileListFragment.java b/src/com/android/soundrecorder/filelist/FileListFragment.java
index c2be1ed..6539e65 100755
--- a/src/com/android/soundrecorder/filelist/FileListFragment.java
+++ b/src/com/android/soundrecorder/filelist/FileListFragment.java
@@ -36,8 +36,8 @@
 import android.content.Intent;
 import android.net.Uri;
 import android.os.Bundle;
-import android.support.v7.widget.LinearLayoutManager;
-import android.support.v7.widget.RecyclerView;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
 import android.view.ActionMode;
 import android.view.LayoutInflater;
 import android.view.Menu;
diff --git a/src/com/android/soundrecorder/filelist/FileListRecyclerAdapter.java b/src/com/android/soundrecorder/filelist/FileListRecyclerAdapter.java
old mode 100644
new mode 100755
index d7e295d..3cad8db
--- a/src/com/android/soundrecorder/filelist/FileListRecyclerAdapter.java
+++ b/src/com/android/soundrecorder/filelist/FileListRecyclerAdapter.java
@@ -32,7 +32,7 @@
 import android.content.ContentResolver;
 import android.content.Context;
 import android.database.Cursor;
-import android.support.v7.widget.RecyclerView;
+import androidx.recyclerview.widget.RecyclerView;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
diff --git a/src/com/android/soundrecorder/filelist/FileListRecyclerView.java b/src/com/android/soundrecorder/filelist/FileListRecyclerView.java
old mode 100644
new mode 100755
index 2d2e82b..4b81e0e
--- a/src/com/android/soundrecorder/filelist/FileListRecyclerView.java
+++ b/src/com/android/soundrecorder/filelist/FileListRecyclerView.java
@@ -30,7 +30,7 @@
 package com.android.soundrecorder.filelist;
 
 import android.content.Context;
-import android.support.v7.widget.RecyclerView;
+import androidx.recyclerview.widget.RecyclerView;
 import android.util.AttributeSet;
 import android.view.View;
 
diff --git a/src/com/android/soundrecorder/filelist/viewholder/BaseViewHolder.java b/src/com/android/soundrecorder/filelist/viewholder/BaseViewHolder.java
old mode 100644
new mode 100755
index 17968be..223c6bf
--- a/src/com/android/soundrecorder/filelist/viewholder/BaseViewHolder.java
+++ b/src/com/android/soundrecorder/filelist/viewholder/BaseViewHolder.java
@@ -29,7 +29,7 @@
 
 package com.android.soundrecorder.filelist.viewholder;
 
-import android.support.v7.widget.RecyclerView;
+import androidx.recyclerview.widget.RecyclerView;
 import android.view.View;
 import android.widget.CheckBox;
 import android.widget.CompoundButton;
diff --git a/src/com/android/soundrecorder/util/FileUtils.java b/src/com/android/soundrecorder/util/FileUtils.java
index 2d471ef..f80637e 100755
--- a/src/com/android/soundrecorder/util/FileUtils.java
+++ b/src/com/android/soundrecorder/util/FileUtils.java
@@ -38,7 +38,7 @@
 import android.content.ContentValues;
 import android.util.Log;
 import android.provider.MediaStore;
-import android.support.v4.content.FileProvider;
+import androidx.core.content.FileProvider;
 import android.os.Build;
 import android.content.ContentUris;
 import android.database.Cursor;