universal7885: FMRadio: Switch to FM V3 aidl interface

This commit is contained in:
roynatech2544 2022-10-29 19:04:41 +09:00
commit 95e7624f55
3 changed files with 5 additions and 2 deletions

View file

@ -12,7 +12,7 @@ android_app {
"com.google.android.material_stable",
"androidx.transition_transition",
"androidx.coordinatorlayout_coordinatorlayout",
"vendor.eureka.hardware.fmradio-V2-java",
"vendor.eureka.hardware.fmradio-V3-java",
],
required: [
"vendor.eureka.hardware.fmradio-service",

View file

@ -7,6 +7,7 @@ import android.media.AudioManager
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.os.Process
import android.view.LayoutInflater
import android.view.View
import androidx.appcompat.app.AlertDialog
@ -23,6 +24,7 @@ import com.eurekateam.fmradio.utils.Log
import com.google.android.material.bottomnavigation.BottomNavigationView
import com.google.android.material.color.DynamicColors
import com.google.android.material.textview.MaterialTextView
import vendor.eureka.hardware.fmradio.SetType
class MainActivity : AppCompatActivity() {
private lateinit var mIntent: Intent
@ -55,6 +57,7 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_navigation)
DynamicColors.applyToActivitiesIfAvailable(application)
mFMInterface.mDevCtl.setValue(SetType.SET_TYPE_FM_APP_PID, Process.myPid())
mFMInterface.mDevCtl.open()
mAudioManager = getSystemService(AUDIO_SERVICE) as AudioManager

View file

@ -17,7 +17,7 @@ import vendor.eureka.hardware.fmradio.SetType
class ListViewAdapter(private val mContext: Context) : BaseAdapter() {
private val mFMInterface = NativeFMInterface()
private val mListChannel = mFMInterface.mDefaultCtl.getFreqsList().sort()
private val mListChannel = mFMInterface.mDefaultCtl.getFreqsList().apply{ sort() }
private var mListofViews = HashMap<Int, View>(30)
private var mInitDoneArray = Array(30){ false }