Lines Matching refs:ctx

116     auto ctx = new TunerContext();
117 ctx->mHalRev = static_cast<HalRevision>(halRev);
118 ctx->mWithAudio = withAudio;
119 ctx->mBand = static_cast<Band>(band);
121 static_assert(sizeof(jlong) >= sizeof(ctx), "jlong is smaller than a pointer");
122 return reinterpret_cast<jlong>(ctx);
129 auto ctx = reinterpret_cast<TunerContext*>(nativeContext);
130 delete ctx;
144 static void notifyAudioService(TunerContext& ctx, bool connected) {
145 if (!ctx.mWithAudio) return;
146 if (ctx.mIsAudioConnected == connected) return;
147 ctx.mIsAudioConnected = connected;
162 auto& ctx = getNativeContext(env, jTuner);
164 if (ctx.mIsClosed) {
169 if (ctx.mHalTuner != nullptr) {
174 ctx.mHalModule = halModule;
175 ctx.mHalModule11 = V1_1::IBroadcastRadio::castFrom(halModule).withDefault(nullptr);
177 ctx.mHalTuner = halTuner;
178 ctx.mHalTuner11 = V1_1::ITuner::castFrom(halTuner).withDefault(nullptr);
179 ALOGW_IF(ctx.mHalRev >= HalRevision::V1_1 && ctx.mHalTuner11 == nullptr,
182 ctx.mHalDeathRecipient = new HalDeathRecipient(getNativeCallback(env, jTuner));
183 halTuner->linkToDeath(ctx.mHalDeathRecipient, 0);
185 notifyAudioService(ctx, true);
188 static sp<V1_0::ITuner> getHalTuner(const TunerContext& ctx) {
189 auto tuner = ctx.mHalTuner;
215 auto& ctx = getNativeContext(nativeContext);
217 if (ctx.mIsClosed) return;
218 ctx.mIsClosed = true;
220 if (ctx.mHalTuner == nullptr) {
225 ALOGI("Closing tuner %p", ctx.mHalTuner.get());
227 notifyAudioService(ctx, false);
229 ctx.mHalTuner->unlinkToDeath(ctx.mHalDeathRecipient);
230 ctx.mHalDeathRecipient = nullptr;
232 ctx.mHalTuner11 = nullptr;
233 ctx.mHalTuner = nullptr;
239 auto& ctx = getNativeContext(nativeContext);
241 auto halTuner = getHalTuner(ctx);
249 ctx.mBand = bandConfigHal.type;
274 auto& ctx = getNativeContext(nativeContext);
276 notifyAudioService(ctx, !mute);
302 auto& ctx = getNativeContext(nativeContext);
304 auto halTuner10 = getHalTuner(ctx);
305 auto halTuner11 = ctx.mHalTuner11;
344 auto& ctx = getNativeContext(nativeContext);
346 auto halTuner10 = getHalTuner(ctx);
347 auto halTuner11 = ctx.mHalTuner11;
365 jInfo = convert::ProgramInfoFromHal(env, info, ctx.mBand);
419 auto& ctx = getNativeContext(nativeContext);
421 if (ctx.mHalModule11 == nullptr) {
427 auto halModule = ctx.mHalModule11.promote();