org.tizen.injector.telephony.call_1.0.0.201310291329

16:50:08.912 INFO  jd.cli.Main - Decompiling org.tizen.injector.telephony.call_1.0.0.201310291329.jar
package org.tizen.injector.telephony.call;

import java.util.ArrayList;
import org.eclipse.jface.viewers.TableViewer;
import org.tizen.injector.model.DefaultTableModel;
import org.tizen.injector.provider.AbstractInjectorItem;
import org.tizen.injector.telephony.call.model.CallListVO;
import org.tizen.injector.telephony.call.page.MOMTCall;

public class TelephonyCall
  extends AbstractInjectorItem
{
  private static MOMTCall callinstance = null;
  private DefaultTableModel model = new DefaultTableModel(new CallListVO());
  private ArrayList<TableViewer> viewerList = new ArrayList();
  
  protected void addPages()
  {
    callinstance = new MOMTCall(this, "CALL", model);
    addPage(callinstance);
  }
  
  public void addViewer(TableViewer paramTableViewer)
  {
    viewerList.add(paramTableViewer);
  }
  
  public void refresh()
  {
    for (int i = 0; i < viewerList.size(); i++) {
      ((TableViewer)viewerList.get(i)).refresh();
    }
  }
  
  public static MOMTCall getinstance()
  {
    return callinstance;
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.telephony.call.TelephonyCall
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.telephony.call.model;

import org.tizen.injector.model.AbstractTableVO;

public class CallListVO
  extends AbstractTableVO
{
  private int callId;
  private int status;
  private int multiParty;
  private int momt;
  private String number;
  
  public int getCallId()
  {
    return callId;
  }
  
  public void setCallId(int paramInt)
  {
    callId = paramInt;
  }
  
  public int getStatus()
  {
    return status;
  }
  
  public void setStatus(int paramInt)
  {
    status = paramInt;
  }
  
  public int getMultiParty()
  {
    return multiParty;
  }
  
  public void setMultiParty(int paramInt)
  {
    multiParty = paramInt;
  }
  
  public int getMomt()
  {
    return momt;
  }
  
  public void setMomt(int paramInt)
  {
    momt = paramInt;
  }
  
  public String getNumber()
  {
    return number;
  }
  
  public void setNumber(String paramString)
  {
    number = paramString;
  }
  
  public String[] getColumnNames()
  {
    return null;
  }
  
  public Object getColumnValue(int paramInt)
  {
    Object localObject = null;
    switch (paramInt)
    {
    case 0: 
      localObject = Integer.valueOf(getCallId());
      break;
    case 1: 
      localObject = Integer.valueOf(getStatus());
      break;
    case 2: 
      localObject = Integer.valueOf(getMultiParty());
      break;
    case 3: 
      localObject = Integer.valueOf(getMomt());
      break;
    case 4: 
      localObject = getNumber();
      break;
    }
    return localObject;
  }
  
  public void setColumnValue(int paramInt, Object paramObject) {}
}

/* Location:
 * Qualified Name:     org.tizen.injector.telephony.call.model.CallListVO
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.telephony.call.page;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class MOMTCall$1
  extends SelectionAdapter
{
  MOMTCall$1(MOMTCall paramMOMTCall) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    switch (MOMTCall.access$9(this$0))
    {
    case 0: 
      MOMTCall.access$10(this$0);
      break;
    case 1: 
      MOMTCall.access$11(this$0);
      break;
    default: 
      MOMTCall.access$12(this$0);
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.telephony.call.page.MOMTCall.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.telephony.call.page;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class MOMTCall$2
  extends SelectionAdapter
{
  MOMTCall$2(MOMTCall paramMOMTCall) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    MOMTCall.access$13(this$0);
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.telephony.call.page.MOMTCall.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.telephony.call.page;

import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;

class MOMTCall$3
  implements ISelectionChangedListener
{
  MOMTCall$3(MOMTCall paramMOMTCall) {}
  
  public void selectionChanged(SelectionChangedEvent paramSelectionChangedEvent)
  {
    IStructuredSelection localIStructuredSelection = (IStructuredSelection)MOMTCall.access$14(this$0).getSelection();
    if (localIStructuredSelection.isEmpty())
    {
      MOMTCall.access$15(this$0).setEnabled(false);
      MOMTCall.access$16(this$0).setEnabled(false);
    }
    else
    {
      MOMTCall.access$15(this$0).setEnabled(true);
      MOMTCall.access$16(this$0).setEnabled(true);
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.telephony.call.page.MOMTCall.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.telephony.call.page;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class MOMTCall$4
  extends SelectionAdapter
{
  MOMTCall$4(MOMTCall paramMOMTCall) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    this$0.callEnd(false);
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.telephony.call.page.MOMTCall.4
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.telephony.call.page;

import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;

class MOMTCall$5
  implements IRunnableWithProgress
{
  MOMTCall$5(MOMTCall paramMOMTCall) {}
  
  public void run(IProgressMonitor paramIProgressMonitor)
    throws InvocationTargetException, InterruptedException
  {
    while (!this$0.isbtenabled) {
      Thread.sleep(100L);
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.telephony.call.page.MOMTCall.5
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.telephony.call.page;

import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Label;
import org.tizen.injector.model.DefaultTableModel;
import org.tizen.injector.protocol.AbstractGA;
import org.tizen.injector.protocol.StructureGA;
import org.tizen.injector.receiver.AbstractInjectorReceiver;
import org.tizen.injector.telephony.call.TelephonyCall;
import org.tizen.injector.telephony.call.model.CallListVO;
import org.tizen.injector.telephony.call.protocol.G01A22;

public class MOMTCall$CallList22Receiver
  extends AbstractInjectorReceiver
{
  public MOMTCall$CallList22Receiver(MOMTCall paramMOMTCall) {}
  
  public void run(AbstractGA paramAbstractGA)
  {
    MOMTCall.access$0(this$0).clear();
    StructureGA localStructureGA1 = paramAbstractGA.getHeader();
    int i = localStructureGA1.getInt("COUNT");
    int j = 0;
    int k = 0;
    this$0.connectBtStatus(true);
    StructureGA localStructureGA2 = paramAbstractGA.getBody();
    this$0.incomming = false;
    for (int m = 0; m < i; m++)
    {
      CallListVO localCallListVO = new CallListVO();
      localCallListVO.setCallId(localStructureGA2.getInt("IDX", m));
      localCallListVO.setStatus(localStructureGA2.getInt("STAT", m) - 1);
      localCallListVO.setMultiParty(localStructureGA2.getInt("MULTIPARTY", m));
      localCallListVO.setMomt(localStructureGA2.getInt("DIR", m) - 1);
      localCallListVO.setNumber(new String(localStructureGA2.getByteArray("NUMBER", m)).trim());
      if (localCallListVO.getStatus() == -1)
      {
        i++;
        j++;
      }
      else
      {
        if ((localCallListVO.getStatus() == 4) || (localCallListVO.getStatus() == 5)) {
          this$0.incomming = true;
        }
        String str1 = localCallListVO.getNumber();
        String str2 = MOMTCall.access$1(this$0).getText();
        if (str1.compareTo(str2) == 0)
        {
          k = 1;
          if ((localCallListVO.getStatus() != 2) && (localCallListVO.getStatus() != 3)) {
            this$0.dialing = false;
          }
        }
        MOMTCall.access$0(this$0).add(localCallListVO);
      }
    }
    i -= j;
    ((TelephonyCall)this$0.getParent()).refresh();
    if (i != 6) {
      this$0.listfull = false;
    }
    if (i == 0) {
      this$0.calling = false;
    }
    if (k == 0)
    {
      MOMTCall.access$2(this$0).setEnabled(false);
      MOMTCall.access$3(this$0).setEnabled(true);
      MOMTCall.access$4(this$0).setEnabled(false);
      this$0.dialing = false;
      MOMTCall.access$5(this$0, 0);
      MOMTCall.access$6(this$0).setText("");
      MOMTCall.access$1(this$0).setText("");
      MOMTCall.access$7(this$0).setText("");
    }
  }
  
  public AbstractGA createTransferObject()
  {
    return new G01A22();
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.telephony.call.page.MOMTCall.CallList22Receiver
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.telephony.call.page;

import org.tizen.injector.model.DefaultTableModel;
import org.tizen.injector.protocol.AbstractGA;
import org.tizen.injector.protocol.StructureGA;
import org.tizen.injector.receiver.AbstractInjectorReceiver;
import org.tizen.injector.telephony.call.TelephonyCall;
import org.tizen.injector.telephony.call.model.CallListVO;
import org.tizen.injector.telephony.call.protocol.G01A26;

public class MOMTCall$CallList26Receiver
  extends AbstractInjectorReceiver
{
  public MOMTCall$CallList26Receiver(MOMTCall paramMOMTCall) {}
  
  public void run(AbstractGA paramAbstractGA)
  {
    MOMTCall.access$0(this$0).clear();
    StructureGA localStructureGA1 = paramAbstractGA.getHeader();
    int i = localStructureGA1.getInt("COUNT");
    this$0.incomming = false;
    this$0.connectBtStatus(true);
    StructureGA localStructureGA2 = paramAbstractGA.getBody();
    for (int j = 0; j < i; j++)
    {
      CallListVO localCallListVO = new CallListVO();
      localCallListVO.setCallId(localStructureGA2.getInt("IDX", j));
      localCallListVO.setStatus(localStructureGA2.getInt("STAT", j) - 1);
      localCallListVO.setMultiParty(localStructureGA2.getInt("MULTIPARTY", j));
      localCallListVO.setMomt(localStructureGA2.getInt("DIR", j) - 1);
      localCallListVO.setNumber(new String(localStructureGA2.getByteArray("NUMBER", j)).trim());
      if (localCallListVO.getStatus() == -1)
      {
        i++;
      }
      else
      {
        if ((localCallListVO.getStatus() == 4) || (localCallListVO.getStatus() == 5)) {
          this$0.incomming = true;
        }
        MOMTCall.access$0(this$0).add(localCallListVO);
        this$0.calling = true;
      }
    }
    ((TelephonyCall)this$0.getParent()).refresh();
  }
  
  public AbstractGA createTransferObject()
  {
    return new G01A26();
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.telephony.call.page.MOMTCall.CallList26Receiver
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.telephony.call.page;

import org.tizen.injector.model.DefaultTableModel;
import org.tizen.injector.protocol.AbstractGA;
import org.tizen.injector.protocol.StructureGA;
import org.tizen.injector.receiver.AbstractInjectorReceiver;
import org.tizen.injector.telephony.call.TelephonyCall;
import org.tizen.injector.telephony.call.model.CallListVO;
import org.tizen.injector.telephony.call.protocol.G01A29;

public class MOMTCall$CallList29Receiver
  extends AbstractInjectorReceiver
{
  public MOMTCall$CallList29Receiver(MOMTCall paramMOMTCall) {}
  
  public void run(AbstractGA paramAbstractGA)
  {
    MOMTCall.access$0(this$0).clear();
    StructureGA localStructureGA1 = paramAbstractGA.getHeader();
    int i = localStructureGA1.getInt("COUNT");
    int j = 0;
    this$0.incomming = false;
    this$0.connectBtStatus(true);
    StructureGA localStructureGA2 = paramAbstractGA.getBody();
    for (int k = 0; k < i; k++)
    {
      CallListVO localCallListVO = new CallListVO();
      localCallListVO.setCallId(localStructureGA2.getInt("IDX", k));
      localCallListVO.setStatus(localStructureGA2.getInt("STAT", k) - 1);
      localCallListVO.setMultiParty(localStructureGA2.getInt("MULTIPARTY", k));
      localCallListVO.setMomt(localStructureGA2.getInt("DIR", k) - 1);
      localCallListVO.setNumber(new String(localStructureGA2.getByteArray("NUMBER", k)).trim());
      if (localCallListVO.getStatus() == -1)
      {
        i++;
        j++;
      }
      else
      {
        if ((localCallListVO.getStatus() == 4) || (localCallListVO.getStatus() == 5)) {
          this$0.incomming = true;
        }
        MOMTCall.access$0(this$0).add(localCallListVO);
        this$0.calling = true;
      }
    }
    i -= j;
    ((TelephonyCall)this$0.getParent()).refresh();
    if (i == 6) {
      this$0.listfull = true;
    } else {
      this$0.listfull = false;
    }
  }
  
  public AbstractGA createTransferObject()
  {
    return new G01A29();
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.telephony.call.page.MOMTCall.CallList29Receiver
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.telephony.call.page;

import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Label;
import org.tizen.injector.protocol.AbstractGA;
import org.tizen.injector.protocol.StructureGA;
import org.tizen.injector.receiver.AbstractInjectorReceiver;
import org.tizen.injector.telephony.call.protocol.G01A21MO;

public class MOMTCall$CallReceiver
  extends AbstractInjectorReceiver
{
  public MOMTCall$CallReceiver(MOMTCall paramMOMTCall) {}
  
  public void run(AbstractGA paramAbstractGA)
  {
    StructureGA localStructureGA = paramAbstractGA.getBody();
    int i = localStructureGA.getInt("CALL_ID");
    int j = localStructureGA.getInt("CALL_TYPE");
    String str = new String(localStructureGA.getByteArray("CALL_NUMBER")).trim();
    MOMTCall.access$6(this$0).setText(new Integer(i).toString());
    MOMTCall.access$1(this$0).setText(str);
    MOMTCall.access$7(this$0).setText(MOMTCall.access$8(this$0)[j]);
    MOMTCall.access$4(this$0).setEnabled(true);
    byte[] arrayOfByte = localStructureGA.getByteArray("CALL_NUMBER");
    if (arrayOfByte[0] == 4)
    {
      this$0.dialing = true;
      MOMTCall.access$4(this$0).setText("Connect");
      MOMTCall.access$5(this$0, 1);
    }
    else
    {
      this$0.dialing = true;
      MOMTCall.access$4(this$0).setText("Alert");
      MOMTCall.access$5(this$0, 0);
    }
    MOMTCall.access$2(this$0).setEnabled(true);
    MOMTCall.access$3(this$0).setEnabled(false);
  }
  
  public AbstractGA createTransferObject()
  {
    return new G01A21MO();
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.telephony.call.page.MOMTCall.CallReceiver
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.telephony.call.page;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.ComboBoxCellEditor;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.tizen.common.connection.ConnectionPlugin;
import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
import org.tizen.injector.InjectorDialog;
import org.tizen.injector.control.TableViewContentProvider;
import org.tizen.injector.control.TableViewLabelProvider;
import org.tizen.injector.model.DefaultTableModel;
import org.tizen.injector.protocol.AbstractGA;
import org.tizen.injector.protocol.StructureGA;
import org.tizen.injector.provider.AbstractInjectorItem;
import org.tizen.injector.provider.AbstractInjectorPage;
import org.tizen.injector.receiver.AbstractInjectorReceiver;
import org.tizen.injector.socket.TelephonySocket;
import org.tizen.injector.telephony.call.TelephonyCall;
import org.tizen.injector.telephony.call.model.CallListVO;
import org.tizen.injector.telephony.call.protocol.G01A07;
import org.tizen.injector.telephony.call.protocol.G01A21MO;
import org.tizen.injector.telephony.call.protocol.G01A21MT;
import org.tizen.injector.telephony.call.protocol.G01A22;
import org.tizen.injector.telephony.call.protocol.G01A22End;
import org.tizen.injector.telephony.call.protocol.G01A23;
import org.tizen.injector.telephony.call.protocol.G01A26;
import org.tizen.injector.telephony.call.protocol.G01A29;
import org.tizen.injector.telephony.call.protocol.G01A62;
import org.tizen.injector.telephony.call.resource.ErrorCode;
import org.tizen.injector.util.FormPageUtil;
import org.tizen.injector.view.InjectorView;
import org.tizen.sdblib.IDevice;
import org.tizen.sdblib.service.FileEntry;

public class MOMTCall
  extends AbstractInjectorPage
  implements ConnectionPlugin.ISelectionListener
{
  boolean listfull = false;
  boolean incomming = false;
  boolean dialing = false;
  boolean calling = false;
  boolean isbtenabled = true;
  private IDevice currentDevice;
  private boolean rssiStatus = true;
  public static final int AT_CALL_STAT_ERR = -1;
  public static final int AT_CALL_STAT_DIALING = 2;
  public static final int AT_CALL_STAT_ALERT = 3;
  public static final int AT_CALL_STAT_INCOMING = 4;
  public static final int AT_CALL_STAT_WAITING = 5;
  private final String[] CALL_TYPE_LIST = { "NONE", "VOICE", "DATA", "VIDEO", "MAX", "", "", "EMERGENCY" };
  private String defaultErrorCode = "CALL OK(Success)";
  private ErrorCode ERROR_CODE_LIST = new ErrorCode();
  private final String[] STATUS = { "ACTIVE", "HELD", "DIALING", "ALERT", "INCOMING", "WAITING", "MAX" };
  private final String[] MO_MT = { "MO", "MT", "MAX" };
  private final String[] MULTIPARTY = { "FALSE", "TRUE" };
  private Label lblMOCallCallId;
  private Label lblMOCallNumber;
  private Label lblMOCallCallType;
  private Button butMOCall;
  private Combo cmbMOCallCallStatus;
  private int MOCallevent;
  private Text txtMTCallNumber;
  private Button butMTCallHidden;
  private Button butMTCallConnect;
  private Combo cmbCallListInformationCallStatus;
  private Button butCallListInformationCallEnd;
  private TableViewer viewer;
  private DefaultTableModel model;
  
  public void setRssiStatus(boolean paramBoolean)
  {
    rssiStatus = paramBoolean;
    if (!paramBoolean) {
      callEnd(true);
    }
  }
  
  public boolean getRssiStatus()
  {
    return rssiStatus;
  }
  
  public MOMTCall(AbstractInjectorItem paramAbstractInjectorItem, String paramString)
  {
    super(paramAbstractInjectorItem, paramString);
  }
  
  public MOMTCall(AbstractInjectorItem paramAbstractInjectorItem, String paramString, DefaultTableModel paramDefaultTableModel)
  {
    super(paramAbstractInjectorItem, paramString);
    model = paramDefaultTableModel;
  }
  
  protected void registerReceivers()
  {
    registerReceiver(new CallList22Receiver());
    registerReceiver(new CallList26Receiver());
    registerReceiver(new CallList29Receiver());
    registerReceiver(new CallReceiver());
  }
  
  protected void createContents()
  {
    InjectorView.getDefault().addSelectionListener(this);
    currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
    createMTCallSection();
    createCallListInformationSection();
    createMOCallSection();
    ((TelephonyCall)getParent()).addViewer(viewer);
  }
  
  private void createMOCallSection()
  {
    Composite localComposite1 = formUtil.createSection(parent, "MO Call (Mobile Origination)");
    Composite localComposite2 = formUtil.createComposite(localComposite1, 2);
    GridData localGridData = new GridData(4, 4, false, true);
    widthHint = 580;
    localComposite2.setLayoutData(localGridData);
    formUtil.createLabel(localComposite2, "Call ID : ");
    lblMOCallCallId = formUtil.createLabel(localComposite2, "");
    formUtil.setWidth(lblMOCallCallId, 350);
    formUtil.createLabel(localComposite2, "Number : ");
    lblMOCallNumber = formUtil.createLabel(localComposite2, "");
    formUtil.setWidth(lblMOCallNumber, 350);
    formUtil.createLabel(localComposite2, "Call Type : ");
    lblMOCallCallType = formUtil.createLabel(localComposite2, "");
    formUtil.setWidth(lblMOCallCallType, 350);
    Composite localComposite3 = formUtil.createComposite(localComposite1, 2);
    localGridData = new GridData(4, 4, false, true);
    widthHint = 580;
    localComposite3.setLayoutData(localGridData);
    cmbMOCallCallStatus = formUtil.createCombo(localComposite3);
    formUtil.setWidth(cmbMOCallCallStatus, 390);
    cmbMOCallCallStatus.setEnabled(false);
    formUtil.addComboItem(cmbMOCallCallStatus, ERROR_CODE_LIST.getErrorList(), defaultErrorCode);
    butMOCall = formUtil.createButton(localComposite3, "Disconnect", 8);
    localGridData = new GridData(4, 4, false, false);
    widthHint = 100;
    butMOCall.setLayoutData(localGridData);
    butMOCall.setEnabled(false);
    MOCallevent = 0;
    butMOCall.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
      {
        switch (MOCallevent)
        {
        case 0: 
          MOMTCall.this.moAlert();
          break;
        case 1: 
          MOMTCall.this.moConnect();
          break;
        default: 
          MOMTCall.this.moDisconnect();
        }
      }
    });
  }
  
  private void createMTCallSection()
  {
    Composite localComposite1 = formUtil.createSection(parent, "MT Call (Mobile Termination)");
    Composite localComposite2 = formUtil.createComposite(localComposite1, 3);
    GridData localGridData = new GridData(4, 4, false, true);
    widthHint = 580;
    localComposite2.setLayoutData(localGridData);
    formUtil.createLabel(localComposite2, "Number : ");
    txtMTCallNumber = formUtil.createText(localComposite2, "");
    formUtil.setWidth(txtMTCallNumber, 362);
    Composite localComposite3 = formUtil.createComposite(localComposite2);
    formUtil.createLabel(localComposite2, "Call Type : ");
    butMTCallHidden = formUtil.createButton(localComposite2, "Hidden", 32);
    butMTCallConnect = formUtil.createButton(localComposite3, "Connect", 8);
    localGridData = new GridData(4, 4, false, false);
    widthHint = 100;
    butMTCallConnect.setLayoutData(localGridData);
    butMTCallConnect.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
      {
        MOMTCall.this.mtConnecct();
      }
    });
  }
  
  private void createCallListInformationSection()
  {
    Composite localComposite1 = formUtil.createSection(parent, "Call List Information");
    GridData localGridData = new GridData(4, 4, false, true);
    widthHint = 580;
    localComposite1.setLayoutData(localGridData);
    String[] arrayOfString = { "Call Id", "Status", "Multiparty", "MO/MT", "Number" };
    viewer = formUtil.createTableViewer(localComposite1, arrayOfString);
    localGridData = new GridData(0, 0, false, true);
    widthHint = 560;
    heightHint = 76;
    viewer.getControl().setLayoutData(localGridData);
    viewer.setCellEditors(new CellEditor[] { 0, new ComboBoxCellEditor(viewer.getTable(), STATUS), new ComboBoxCellEditor(viewer.getTable(), MULTIPARTY), new ComboBoxCellEditor(viewer.getTable(), MO_MT) });
    viewer.setContentProvider(new TableViewContentProvider());
    viewer.setLabelProvider(new TableViewLabelProvider(viewer));
    viewer.setInput(model);
    viewer.addSelectionChangedListener(new ISelectionChangedListener()
    {
      public void selectionChanged(SelectionChangedEvent paramAnonymousSelectionChangedEvent)
      {
        IStructuredSelection localIStructuredSelection = (IStructuredSelection)viewer.getSelection();
        if (localIStructuredSelection.isEmpty())
        {
          cmbCallListInformationCallStatus.setEnabled(false);
          butCallListInformationCallEnd.setEnabled(false);
        }
        else
        {
          cmbCallListInformationCallStatus.setEnabled(true);
          butCallListInformationCallEnd.setEnabled(true);
        }
      }
    });
    Composite localComposite2 = formUtil.createComposite(localComposite1, 2);
    localGridData = new GridData(4, 4, false, true);
    widthHint = 580;
    localComposite2.setLayoutData(localGridData);
    cmbCallListInformationCallStatus = formUtil.createCombo(localComposite2);
    formUtil.setWidth(cmbCallListInformationCallStatus, 390);
    formUtil.addComboItem(cmbCallListInformationCallStatus, ERROR_CODE_LIST.getErrorList(), defaultErrorCode);
    cmbCallListInformationCallStatus.setEnabled(false);
    butCallListInformationCallEnd = formUtil.createButton(localComposite2, "Disconnect", 8);
    localGridData = new GridData(4, 4, false, false);
    widthHint = 100;
    butCallListInformationCallEnd.setLayoutData(localGridData);
    butCallListInformationCallEnd.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
      {
        callEnd(false);
      }
    });
    butCallListInformationCallEnd.setEnabled(false);
  }
  
  public void callEnd(boolean paramBoolean)
  {
    if (paramBoolean) {
      viewer.getTable().setSelection(0, 5);
    }
    IStructuredSelection localIStructuredSelection = (IStructuredSelection)viewer.getSelection();
    if (localIStructuredSelection.isEmpty()) {
      return;
    }
    Object[] arrayOfObject = localIStructuredSelection.toArray();
    for (int i = 0; i < arrayOfObject.length; i++)
    {
      int j = ERROR_CODE_LIST.getKey(cmbCallListInformationCallStatus.getText());
      int k = j & 0xFF;
      int m = j >> 8 & 0xFF;
      int n = ((CallListVO)arrayOfObject[i]).getCallId();
      G01A07 localG01A07 = new G01A07();
      localG01A07.intialize();
      StructureGA localStructureGA1 = localG01A07.getBody();
      localStructureGA1.setInt("ERROR_CAUSE_0", k);
      localStructureGA1.setInt("ERROR_CAUSE_1", m);
      G01A22End localG01A22End = new G01A22End();
      localG01A22End.intialize();
      StructureGA localStructureGA2 = localG01A22End.getBody();
      localStructureGA2.setInt("CALL_ID", n);
      try
      {
        injectorSocket.send(localG01A07);
        injectorSocket.send(localG01A22End);
        String str = lblMOCallCallId.getText();
        if ((str != "") && (n == Integer.parseInt(str)))
        {
          cmbMOCallCallStatus.setEnabled(false);
          butMTCallConnect.setEnabled(true);
          butMOCall.setEnabled(false);
          dialing = false;
          MOCallevent = 0;
          lblMOCallCallId.setText("");
          lblMOCallNumber.setText("");
          lblMOCallCallType.setText("");
        }
      }
      catch (IOException localIOException)
      {
        localIOException.printStackTrace();
        cmbMOCallCallStatus.setEnabled(false);
        butMTCallConnect.setEnabled(true);
        butMOCall.setEnabled(false);
        dialing = false;
        MOCallevent = 0;
        lblMOCallCallId.setText("");
        lblMOCallNumber.setText("");
        lblMOCallCallType.setText("");
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
        cmbMOCallCallStatus.setEnabled(false);
        butMTCallConnect.setEnabled(true);
        butMOCall.setEnabled(false);
        dialing = false;
        MOCallevent = 0;
        lblMOCallCallId.setText("");
        lblMOCallNumber.setText("");
        lblMOCallCallType.setText("");
      }
    }
  }
  
  private void moDisconnect()
  {
    int i = ERROR_CODE_LIST.getKey(cmbMOCallCallStatus.getText());
    int j = i & 0xFF;
    int k = i >> 8 & 0xFF;
    String str = lblMOCallCallId.getText();
    G01A07 localG01A07 = new G01A07();
    localG01A07.intialize();
    StructureGA localStructureGA1 = localG01A07.getBody();
    localStructureGA1.setInt("ERROR_CAUSE_0", j);
    localStructureGA1.setInt("ERROR_CAUSE_1", k);
    G01A22End localG01A22End = new G01A22End();
    localG01A22End.intialize();
    StructureGA localStructureGA2 = localG01A22End.getBody();
    localStructureGA2.setInt("CALL_ID", Integer.parseInt(str));
    try
    {
      injectorSocket.send(localG01A07);
      injectorSocket.send(localG01A22End);
      cmbMOCallCallStatus.setEnabled(false);
      butMTCallConnect.setEnabled(true);
      butMOCall.setEnabled(false);
      dialing = false;
      MOCallevent = 0;
      lblMOCallCallId.setText("");
      lblMOCallNumber.setText("");
      lblMOCallCallType.setText("");
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }
  
  private void moAlert()
  {
    G01A62 localG01A62 = new G01A62();
    localG01A62.intialize();
    try
    {
      injectorSocket.send(localG01A62);
      butMTCallConnect.setEnabled(true);
      butMOCall.setText("Connect");
      MOCallevent = 1;
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }
  
  private void moConnect()
  {
    G01A23 localG01A23 = new G01A23();
    localG01A23.intialize();
    try
    {
      injectorSocket.send(localG01A23);
      dialing = false;
      butMOCall.setText("Disconnect");
      MOCallevent = 2;
    }
    catch (IOException localIOException)
    {
      dialing = true;
      localIOException.printStackTrace();
    }
    catch (Exception localException)
    {
      dialing = true;
      localException.printStackTrace();
    }
  }
  
  public static boolean checkNumberFormat(String paramString)
  {
    Pattern localPattern = Pattern.compile("[^0-9++]");
    Matcher localMatcher = localPattern.matcher(paramString);
    return localMatcher.find();
  }
  
  public void showDialog(String paramString)
  {
    Shell localShell = parent.getShell();
    InjectorDialog.openInfoDialog(localShell, InjectorDialog.TITLE, paramString);
    connectBtStatus(true);
  }
  
  public void connectBtStatus(boolean paramBoolean)
  {
    butMTCallConnect.setEnabled(paramBoolean);
    isbtenabled = paramBoolean;
  }
  
  private void mtConnecct()
  {
    connectBtStatus(false);
    String str = txtMTCallNumber.getText().trim();
    if ((str == null) || (str.length() == 0))
    {
      showDialog("Please input the phone number.");
      butMTCallConnect.setEnabled(true);
      return;
    }
    if (str.length() > 82)
    {
      showDialog("The maximum length of phone number is 82.");
      return;
    }
    if (checkNumberFormat(str))
    {
      showDialog("Wrong phone number.");
      return;
    }
    if (!rssiStatus)
    {
      showDialog("RSSI level is zero.\nPlease try again later.");
      return;
    }
    if (listfull)
    {
      Shell localShell = parent.getShell();
      InjectorDialog.openInfoDialog(localShell, InjectorDialog.TITLE, "There are many pending connections.\nCan't connect anymore.");
    }
    if ((incomming) || (dialing))
    {
      showDialog("User is busy.\nPlease try again later.");
      return;
    }
    if ((!getInstancecallWaiting) && (calling))
    {
      showDialog("User is busy.\nCall waiting mode of emulator is off.\nPlease try again later.");
      return;
    }
    int i = 1;
    int j = 0;
    int k = butMTCallHidden.getSelection() ? 1 : 0;
    int m = 1;
    int n = 1;
    int i1 = 0;
    G01A21MT localG01A21MT = new G01A21MT();
    localG01A21MT.intialize();
    StructureGA localStructureGA = localG01A21MT.getBody();
    localStructureGA.setInt("CALL_TYPE", i);
    localStructureGA.setInt("FORWARDED_STATUS", j);
    localStructureGA.setInt("CLIR_STATUS", k);
    localStructureGA.setInt("NUM_LEN", str.getBytes().length);
    localStructureGA.setInt("NUM_TYPE", m);
    localStructureGA.setInt("CLI_PRESENT_ID", n);
    localStructureGA.setInt("NO_CLI_CAUSE", i1);
    localStructureGA.setByteArray("CALL_NUMBER", str.getBytes());
    try
    {
      injectorSocket.send(localG01A21MT);
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
    }
    catch (Exception localException1)
    {
      localException1.printStackTrace();
    }
    try
    {
      new ProgressMonitorDialog(parent.getShell()).run(true, false, new IRunnableWithProgress()
      {
        public void run(IProgressMonitor paramAnonymousIProgressMonitor)
          throws InvocationTargetException, InterruptedException
        {
          while (!isbtenabled) {
            Thread.sleep(100L);
          }
        }
      });
      if ((!getInstancecallWaiting) && (calling) && (!incomming))
      {
        showDialog("User is busy.\nCall waiting mode of emulator is off.\nPlease try again later.");
        return;
      }
    }
    catch (InterruptedException localInterruptedException)
    {
      localInterruptedException.printStackTrace();
    }
    catch (Exception localException2)
    {
      localException2.printStackTrace();
    }
  }
  
  public void selectionChanged(FileEntry paramFileEntry)
  {
    if (paramFileEntry == null) {
      return;
    }
    if ((currentDevice != null) && (currentDevice.getSerialNumber() != paramFileEntry.getDevice().getSerialNumber())) {
      try
      {
        viewer.getTable().removeAll();
        cmbMOCallCallStatus.setEnabled(false);
        butMTCallConnect.setEnabled(true);
        butMOCall.setEnabled(false);
        dialing = false;
        MOCallevent = 0;
        lblMOCallCallId.setText("");
        lblMOCallNumber.setText("");
        lblMOCallCallType.setText("");
        TelephonySocket.getInstance().sendAskData();
      }
      catch (IOException localIOException)
      {
        localIOException.printStackTrace();
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
      }
    }
    currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
  }
  
  public class CallList22Receiver
    extends AbstractInjectorReceiver
  {
    public CallList22Receiver() {}
    
    public void run(AbstractGA paramAbstractGA)
    {
      model.clear();
      StructureGA localStructureGA1 = paramAbstractGA.getHeader();
      int i = localStructureGA1.getInt("COUNT");
      int j = 0;
      int k = 0;
      connectBtStatus(true);
      StructureGA localStructureGA2 = paramAbstractGA.getBody();
      incomming = false;
      for (int m = 0; m < i; m++)
      {
        CallListVO localCallListVO = new CallListVO();
        localCallListVO.setCallId(localStructureGA2.getInt("IDX", m));
        localCallListVO.setStatus(localStructureGA2.getInt("STAT", m) - 1);
        localCallListVO.setMultiParty(localStructureGA2.getInt("MULTIPARTY", m));
        localCallListVO.setMomt(localStructureGA2.getInt("DIR", m) - 1);
        localCallListVO.setNumber(new String(localStructureGA2.getByteArray("NUMBER", m)).trim());
        if (localCallListVO.getStatus() == -1)
        {
          i++;
          j++;
        }
        else
        {
          if ((localCallListVO.getStatus() == 4) || (localCallListVO.getStatus() == 5)) {
            incomming = true;
          }
          String str1 = localCallListVO.getNumber();
          String str2 = lblMOCallNumber.getText();
          if (str1.compareTo(str2) == 0)
          {
            k = 1;
            if ((localCallListVO.getStatus() != 2) && (localCallListVO.getStatus() != 3)) {
              dialing = false;
            }
          }
          model.add(localCallListVO);
        }
      }
      i -= j;
      ((TelephonyCall)getParent()).refresh();
      if (i != 6) {
        listfull = false;
      }
      if (i == 0) {
        calling = false;
      }
      if (k == 0)
      {
        cmbMOCallCallStatus.setEnabled(false);
        butMTCallConnect.setEnabled(true);
        butMOCall.setEnabled(false);
        dialing = false;
        MOCallevent = 0;
        lblMOCallCallId.setText("");
        lblMOCallNumber.setText("");
        lblMOCallCallType.setText("");
      }
    }
    
    public AbstractGA createTransferObject()
    {
      return new G01A22();
    }
  }
  
  public class CallList26Receiver
    extends AbstractInjectorReceiver
  {
    public CallList26Receiver() {}
    
    public void run(AbstractGA paramAbstractGA)
    {
      model.clear();
      StructureGA localStructureGA1 = paramAbstractGA.getHeader();
      int i = localStructureGA1.getInt("COUNT");
      incomming = false;
      connectBtStatus(true);
      StructureGA localStructureGA2 = paramAbstractGA.getBody();
      for (int j = 0; j < i; j++)
      {
        CallListVO localCallListVO = new CallListVO();
        localCallListVO.setCallId(localStructureGA2.getInt("IDX", j));
        localCallListVO.setStatus(localStructureGA2.getInt("STAT", j) - 1);
        localCallListVO.setMultiParty(localStructureGA2.getInt("MULTIPARTY", j));
        localCallListVO.setMomt(localStructureGA2.getInt("DIR", j) - 1);
        localCallListVO.setNumber(new String(localStructureGA2.getByteArray("NUMBER", j)).trim());
        if (localCallListVO.getStatus() == -1)
        {
          i++;
        }
        else
        {
          if ((localCallListVO.getStatus() == 4) || (localCallListVO.getStatus() == 5)) {
            incomming = true;
          }
          model.add(localCallListVO);
          calling = true;
        }
      }
      ((TelephonyCall)getParent()).refresh();
    }
    
    public AbstractGA createTransferObject()
    {
      return new G01A26();
    }
  }
  
  public class CallList29Receiver
    extends AbstractInjectorReceiver
  {
    public CallList29Receiver() {}
    
    public void run(AbstractGA paramAbstractGA)
    {
      model.clear();
      StructureGA localStructureGA1 = paramAbstractGA.getHeader();
      int i = localStructureGA1.getInt("COUNT");
      int j = 0;
      incomming = false;
      connectBtStatus(true);
      StructureGA localStructureGA2 = paramAbstractGA.getBody();
      for (int k = 0; k < i; k++)
      {
        CallListVO localCallListVO = new CallListVO();
        localCallListVO.setCallId(localStructureGA2.getInt("IDX", k));
        localCallListVO.setStatus(localStructureGA2.getInt("STAT", k) - 1);
        localCallListVO.setMultiParty(localStructureGA2.getInt("MULTIPARTY", k));
        localCallListVO.setMomt(localStructureGA2.getInt("DIR", k) - 1);
        localCallListVO.setNumber(new String(localStructureGA2.getByteArray("NUMBER", k)).trim());
        if (localCallListVO.getStatus() == -1)
        {
          i++;
          j++;
        }
        else
        {
          if ((localCallListVO.getStatus() == 4) || (localCallListVO.getStatus() == 5)) {
            incomming = true;
          }
          model.add(localCallListVO);
          calling = true;
        }
      }
      i -= j;
      ((TelephonyCall)getParent()).refresh();
      if (i
1 2

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd