Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa6753b9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Implement JNI frontend methods"

parents e59c8ad5 e32fb417
Loading
Loading
Loading
Loading
+48 −8
Original line number Diff line number Diff line
@@ -377,6 +377,15 @@ int JTuner::tune(const FrontendSettings& settings) {
    return (int)result;
}

int JTuner::stopTune() {
    if (mFe == NULL) {
        ALOGE("frontend is not initialized");
        return (int)Result::INVALID_STATE;
    }
    Result result = mFe->stopTune();
    return (int)result;
}

int JTuner::scan(const FrontendSettings& settings, FrontendScanType scanType) {
    if (mFe == NULL) {
        ALOGE("frontend is not initialized");
@@ -386,6 +395,33 @@ int JTuner::scan(const FrontendSettings& settings, FrontendScanType scanType) {
    return (int)result;
}

int JTuner::stopScan() {
    if (mFe == NULL) {
        ALOGE("frontend is not initialized");
        return (int)Result::INVALID_STATE;
    }
    Result result = mFe->stopScan();
    return (int)result;
}

int JTuner::setLnb(int id) {
    if (mFe == NULL) {
        ALOGE("frontend is not initialized");
        return (int)Result::INVALID_STATE;
    }
    Result result = mFe->setLnb(id);
    return (int)result;
}

int JTuner::setLna(bool enable) {
    if (mFe == NULL) {
        ALOGE("frontend is not initialized");
        return (int)Result::INVALID_STATE;
    }
    Result result = mFe->setLna(enable);
    return (int)result;
}

bool JTuner::openDemux() {
    if (mTuner == nullptr) {
        return false;
@@ -1079,8 +1115,9 @@ static int android_media_tv_Tuner_tune(JNIEnv *env, jobject thiz, jint type, job
    return tuner->tune(getFrontendSettings(env, type, settings));
}

static int android_media_tv_Tuner_stop_tune(JNIEnv*, jobject) {
    return 0;
static int android_media_tv_Tuner_stop_tune(JNIEnv *env, jobject thiz) {
    sp<JTuner> tuner = getTuner(env, thiz);
    return tuner->stopTune();
}

static int android_media_tv_Tuner_scan(
@@ -1090,16 +1127,19 @@ static int android_media_tv_Tuner_scan(
            env, settingsType, settings), static_cast<FrontendScanType>(scanType));
}

static int android_media_tv_Tuner_stop_scan(JNIEnv*, jobject) {
    return 0;
static int android_media_tv_Tuner_stop_scan(JNIEnv *env, jobject thiz) {
    sp<JTuner> tuner = getTuner(env, thiz);
    return tuner->stopScan();
}

static int android_media_tv_Tuner_set_lnb(JNIEnv*, jobject, jint) {
    return 0;
static int android_media_tv_Tuner_set_lnb(JNIEnv *env, jobject thiz, jint id) {
    sp<JTuner> tuner = getTuner(env, thiz);
    return tuner->setLnb(id);
}

static int android_media_tv_Tuner_set_lna(JNIEnv*, jobject, jint, jboolean) {
    return 0;
static int android_media_tv_Tuner_set_lna(JNIEnv *env, jobject thiz, jboolean enable) {
    sp<JTuner> tuner = getTuner(env, thiz);
    return tuner->setLna(enable);
}

static jobject android_media_tv_Tuner_get_frontend_status(JNIEnv, jobject, jintArray) {
+4 −0
Original line number Diff line number Diff line
@@ -133,7 +133,11 @@ struct JTuner : public RefBase {
    jobject getFrontendIds();
    jobject openFrontendById(int id);
    int tune(const FrontendSettings& settings);
    int stopTune();
    int scan(const FrontendSettings& settings, FrontendScanType scanType);
    int stopScan();
    int setLnb(int id);
    int setLna(bool enable);
    jobject getLnbIds();
    jobject openLnbById(int id);
    jobject openFilter(DemuxFilterType type, int bufferSize);