Ejemplo n.º 1
0
        public virtual void toggleMethodProfiling()
        {
            bool canStream = mClientData.hasFeature(ClientData.FEATURE_PROFILING_STREAMING);

            try
            {
                if (mClientData.methodProfilingStatus == ClientData.MethodProfilingStatus.ON)
                {
                    if (canStream)
                    {
                        HandleProfiling.sendMPSE(this);
                    }
                    else
                    {
                        HandleProfiling.sendMPRE(this);
                    }
                }
                else
                {
                    int bufferSize = DdmPreferences.profilerBufferSizeMb * 1024 * 1024;
                    if (canStream)
                    {
                        HandleProfiling.sendMPSS(this, bufferSize, 0);                         //flags
                    }
                    else
                    {
                        string file = "/sdcard/" + mClientData.clientDescription.replaceAll("\\:.*", "") + DdmConstants.DOT_TRACE;
                        HandleProfiling.sendMPRS(this, file, bufferSize, 0);                         //flags
                    }
                }
            }
            catch (IOException)
            {
                Log.w("ddms", "Toggle method profiling failed");
                // ignore
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sends HELLO-type commands to the VM after a good handshake. </summary>
        /// <param name="client"> </param>
        /// <param name="serverProtocolVersion"> </param>
        /// <exception cref="IOException"> </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public static void sendHelloCommands(Client client, int serverProtocolVersion) throws java.io.IOException
        public static void sendHelloCommands(Client client, int serverProtocolVersion)
        {
            sendHELO(client, serverProtocolVersion);
            sendFEAT(client);
            HandleProfiling.sendMPRQ(client);
        }