001    /**
002     * Copyright (C) 2010, Skype Limited
003     *
004     * All intellectual property rights, including but not limited to copyrights,
005     * trademarks and patents, as well as know how and trade secrets contained in,
006     * relating to, or arising from the internet telephony software of
007     * Skype Limited (including its affiliates, "Skype"), including without
008     * limitation this source code, Skype API and related material of such
009     * software proprietary to Skype and/or its licensors ("IP Rights") are and
010     * shall remain the exclusive property of Skype and/or its licensors.
011     * The recipient hereby acknowledges and agrees that any unauthorized use of
012     * the IP Rights is a violation of intellectual property laws.
013     *
014     * Skype reserves all rights and may take legal action against infringers of
015     * IP Rights.
016     *
017     * The recipient agrees not to remove, obscure, make illegible or alter any
018     * notices or indications of the IP Rights and/or Skype's rights and
019     * ownership thereof.
020     */
021    
022    
023    package com.skype.util;
024    
025    import android.content.Context;
026    
027    public class SkypeKitStartOptions
028    {
029            public boolean scoreDumpEnabled;
030            public boolean netloggerEnabled;
031            public boolean tlsEnabled;
032            public boolean moreIpcThreadsEnabled;
033            // enable if skypekit exe needs to be provided android system property file descriptor. If unsure set to false.
034            public boolean sys_property_support;
035            public String scoreDumpPath;
036            public String logfileName;
037            public String  audioIpcKey;
038            public String videoIpcKey; 
039            public String dbPath;
040            public int port; // when -1 localsocket is used.
041    
042            public SkypeKitStartOptions(Context context)
043            {
044                    scoreDumpEnabled = false;
045                    netloggerEnabled = false;
046                    tlsEnabled = false;
047                    moreIpcThreadsEnabled = false;
048                    sys_property_support = false;
049                    scoreDumpPath = new String("");
050                    logfileName = new String("");
051                    audioIpcKey = new String("/tmp/");
052                    videoIpcKey = new String("/tmp/");
053                    dbPath = new String("") + context.getFilesDir().getAbsolutePath();
054                    port = -1;
055            }
056    
057            public String getCmdLineArgs()
058            {
059    
060                    String cmdLineArgs = new String("");
061                    
062                    if(port == -1)
063                    {
064                            cmdLineArgs += " -l SkypeKit ";
065                    }
066                    else
067                    {
068                            cmdLineArgs += " -P " + port;
069                    }
070    
071                    if(!netloggerEnabled)
072                    {
073                            cmdLineArgs += " -x ";
074                    }
075    
076                    if(!tlsEnabled)
077                    {
078                            cmdLineArgs += " -n ";  
079                    }       
080            
081                    if(moreIpcThreadsEnabled)
082                    {
083                            cmdLineArgs += " -T 3 -t 3 "; 
084                    }               
085    
086                    cmdLineArgs += " -sa " + audioIpcKey;
087                    cmdLineArgs += " -sv " + videoIpcKey;
088                    
089                    if(logfileName.length() != 0)
090                    {
091                            cmdLineArgs += " -d " + logfileName;
092                    }
093                    
094                    if(dbPath.length() != 0)
095                    {
096                            cmdLineArgs += " -f " + dbPath;
097                    }
098    
099                    return cmdLineArgs;
100            }
101    }
102