[MTCB Software Development] Styleboila:
I have a problem that my monkeyboard Dab receiver needs audio in. This can be switched with the avin app. But I only need the Audio switched not the video. Is it possible to make a Task with Tasker or similar to run some code or script to switch the audio.

Because also after boot the avin app is blocking the system. For example pppwidget starts only after exiting the avin app.

I also did take a look at the code of the app but I am a completely noob at java app programming and could not identify the code for switching the audio.

Can anyone understand and help me please?

Thanks

I am on malaysk kitkat rom.

here is the code i could decompile. Maybe it is useful for my Problem

MTCAVIN.apk com microntek avin AVINActivity.java

package com.microntek.avin;

import android.app.Activity;

import android.content.BroadcastReceiver;

import android.content.Context;

import android.content.Intent;

import android.content.IntentFilter;

import android.media.AudioManager;

import android.os.Bundle;

import android.os.Handler;

import android.os.Message;

import android.provider.Settings.System;

import android.view.View;

import android.view.View.OnClickListener;

import android.view.Window;

import android.view.WindowManager.LayoutParams;

import android.widget.ImageView;

public class AVINActivity extends Activity {

private static boolean activityVisible;

private static boolean statusbarshow;

private static boolean videoEnable;

private BroadcastReceiver AVINBootReceiver;

private final int MSG_CAPTURE_OFF;

private final int MSG_CAPTURE_ON;

private final int MSG_TIME_TICK;

private final int MSG_VIDEO_CHECK;

private AudioManager am;

private Handler mHandler;

private ImageView mImageBlack;

private ImageView mImageScreen;

private boolean mInChannel;

private boolean mIsSignal;

private View mTextWarning;

private View signalshow;

private int startbackflag;

private int statusbarhidetime;

/* renamed from: com.microntek.avin.AVINActivity.1 */

class C00001 extends Handler {

C00001() {

}

public void handleMessage(Message msg) {

super.handleMessage(msg);

switch (msg.what) {

case 65281:

AVINActivity.this.captureOn();

case 65282:

AVINActivity.this.captureOff();

case 65283:

AVINActivity.this.videoCheck();

case 65284:

AVINActivity.this.refresTick();

AVINActivity.this.mHandler.sendEmptyMessageDelayed(65284, 1000);

default:

}

}

}

/* renamed from: com.microntek.avin.AVINActivity.2 */

class C00012 implements OnClickListener {

C00012() {

}

public void onClick(View v) {

if (!AVINActivity.statusbarshow) {

AVINActivity.statusbarshow = true;

AVINActivity.this.mHandler.removeMessages(65284);

AVINActivity.this.mHandler.sendEmptyMessageDelayed(65284, 1000);

AVINActivity.this.statusbarhidetime = 0;

AVINActivity.this.resumeStatusBar();

} else if (AVINActivity.this.mIsSignal && AVINActivity.videoEnable) {

AVINActivity.statusbarshow = false;

AVINActivity.this.hideStatusBar();

}

}

}

/* renamed from: com.microntek.avin.AVINActivity.3 */

class C00023 extends BroadcastReceiver {

C00023() {

}

public void onReceive(Context arg0, Intent arg1) {

String action = arg1.getAction();

if (action.equals("com.microntek.bootcheck")) {

String classname = arg1.getStringExtra("class");

if (!classname.equals("com.microntek.avin") && !classname.equals("phonecallin") && !classname.equals("phonecallout")) {

AVINActivity.this.sendFinish();

}

} else if (action.equals("com.microntek.carstatechange")) {

if (AVINActivity.activityVisible && arg1.getStringExtra("type").equals("SAFE")) {

AVINActivity.videoEnable = AVINActivity.this.GetDrivingVideoEnable();

AVINActivity.this.mHandler.removeMessages(65283);

AVINActivity.this.mHandler.sendEmptyMessageDelayed(65283, 100);

}

} else if (action.equals("com.microntek.videosignalchange") && arg1.getStringExtra("type").equals("avin")) {

AVINActivity.this.mIsSignal = arg1.getBooleanExtra("sta", true);

AVINActivity.videoEnable = AVINActivity.this.GetDrivingVideoEnable();

AVINActivity.this.mHandler.removeMessages(65283);

AVINActivity.this.mHandler.sendEmptyMessageDelayed(65283, 100);

}

}

}

public AVINActivity() {

this.MSG_CAPTURE_ON = 65281;

this.MSG_CAPTURE_OFF = 65282;

this.MSG_VIDEO_CHECK = 65283;

this.MSG_TIME_TICK = 65284;

this.mImageBlack = null;

this.mTextWarning = null;

this.signalshow = null;

this.mImageScreen = null;

this.mIsSignal = true;

this.startbackflag = 0;

this.statusbarhidetime = 0;

this.am = null;

this.mInChannel = false;

this.mHandler = new C00001();

this.AVINBootReceiver = new C00023();

}

static {

videoEnable = false;

activityVisible = false;

statusbarshow = true;

}

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

this.startbackflag = getIntent().getIntExtra("start", 0);

if (this.startbackflag != 0) {

moveTaskToBack(true);

}

Intent it1 = new Intent("com.microntek.bootcheck");

it1.putExtra("class", "com.microntek.avin");

sendBroadcast(it1);

this.am = (AudioManager) getSystemService("audio");

this.statusbarhidetime = 0;

setContentView(R.layout.main);

this.signalshow = findViewById(R.id.signalshow);

this.mImageScreen = (ImageView) findViewById(R.id.screen);

this.mImageScreen.setOnClickListener(new C00012());

this.mImageBlack = (ImageView) findViewById(R.id.black);

this.mTextWarning = findViewById(R.id.safewarning);

IntentFilter itfl = new IntentFilter();

itfl.addAction("com.microntek.bootcheck");

itfl.addAction("com.microntek.carstatechange");

itfl.addAction("com.microntek.videosignalchange");

registerReceiver(this.AVINBootReceiver, itfl);

deviceOn();

sendCanBusAvinOn();

this.mHandler.sendEmptyMessageDelayed(65284, 1000);

}

private void sendFinish() {

deviceOff();

finish();

}

private void deviceOn() {

if (!this.mInChannel) {

this.am.setParameters("av_channel_enter=line");

this.mInChannel = true;

}

}

private void deviceOff() {

if (this.mInChannel) {

this.mInChannel = false;

this.am.setParameters("av_channel_exit=line");

}

}

private void sendCanBusAvinOn() {

Intent it1 = new Intent("com.microntek.canbusdisplay");

it1.putExtra("type", "avin-on");

sendBroadcast(it1);

}

private void sendCanBusAvinOff() {

Intent it1 = new Intent("com.microntek.canbusdisplay");

it1.putExtra("type", "avin-off");

sendBroadcast(it1);

}

public void onBackPressed() {

sendFinish();

}

private void refresTick() {

if (!this.mIsSignal) {

boolean en = GetDrivingVideoEnable();

if (videoEnable != en) {

videoEnable = en;

this.mHandler.removeMessages(65283);

this.mHandler.sendEmptyMessageDelayed(65283, 100);

}

}

if (this.statusbarhidetime < 10) {

this.statusbarhidetime++;

if (this.statusbarhidetime == 10 && videoEnable && statusbarshow) {

statusbarshow = false;

hideStatusBar();

}

}

}

private boolean GetDrivingVideoEnable() {

if (System.getInt(getContentResolver(), "DrivingVideoEN", 0) != 0) {

return true;

}

if (this.am.getParameters("sta_driving=").equals("true")) {

return false;

}

return true;

}

public void hideStatusBar() {

if (this.mIsSignal) {

Window win = getWindow();

LayoutParams winParams = win.getAttributes();

winParams.flags |= 1024;

win.setAttributes(winParams);

}

}

public void resumeStatusBar() {

Window win = getWindow();

LayoutParams winParams = win.getAttributes();

winParams.flags &= -1025;

win.setAttributes(winParams);

}

protected void onResume() {

super.onResume();

statusbarshow = true;

activityVisible = true;

resumeStatusBar();

captureOn();

videoEnable = GetDrivingVideoEnable();

this.mHandler.sendEmptyMessageDelayed(65283, 100);

sendBroadcast(new Intent("com.microntek.musicclockreset"));

}

protected void onPause() {

activityVisible = false;

captureOff();

super.onPause();

}

protected void onDestroy() {

this.mHandler.removeCallbacksAndMessages(null);

unregisterReceiver(this.AVINBootReceiver);

deviceOff();

sendCanBusAvinOff();

super.onDestroy();

}

protected void videoCheck() {

if (videoEnable) {

this.mTextWarning.setVisibility(4);

} else {

this.mTextWarning.setVisibility(0);

}

if (this.mIsSignal) {

this.signalshow.setVisibility(8);

return;

}

this.signalshow.setVisibility(0);

this.statusbarhidetime = 0;

if (!statusbarshow) {

resumeStatusBar();

}

statusbarshow = true;

}

protected void captureOn() {

this.am.setParameters("ctl_capture_on=line");

this.mImageBlack.setVisibility(4);

}

protected void captureOff() {

this.mImageBlack.setVisibility(0);

this.am.setParameters("ctl_capture_off=line");

}

}

Privacy Policy