internal void OnDisable()
        {
            if (!AndroidBridge.AndroidExtensionsInstalled)
            {
                return;
            }

            if (m_Runtime == null)
            {
                AndroidLogcatInternalLog.Log("Runtime was already destroyed.");
                return;
            }
            m_Runtime.UserSettings.Tags.TagSelectionChanged -= TagSelectionChanged;

            m_Runtime.Closing -= OnDisable;

            m_Runtime.DeviceQuery.DeviceSelected -= OnSelectedDevice;

            if (m_Runtime.Settings != null)
            {
                m_Runtime.Settings.OnSettingsChanged -= OnSettingsChanged;
            }

            StopLogCat();

            m_Runtime.Update -= OnUpdate;
            AndroidLogcatInternalLog.Log("OnDisable, Auto select: {0}", m_AutoSelectPackage);
            m_Runtime = null;
        }
        private void OnEnable()
        {
            if (!AndroidBridge.AndroidExtensionsInstalled)
            {
                return;
            }

            m_Runtime = AndroidLogcatManager.instance.Runtime;
            m_Runtime.DeviceQuery.DevicesUpdated += DeviceQuery_DevicesUpdated;

            DeviceQuery_DevicesUpdated();

            if (m_Runtime.DeviceQuery.SelectedDevice != null)
            {
                var id = m_Runtime.DeviceQuery.SelectedDevice.Id;
                for (int i = 0; i < m_Devices.Length; i++)
                {
                    if (id == m_Devices[i].text)
                    {
                        m_SelectedDevice = i;
                        break;
                    }
                }
            }
        }
        protected void OnEnableInternal(AndroidLogcatRuntimeBase runtime)
        {
            AndroidLogcatInternalLog.Log("OnEnable");
            m_Runtime = runtime;

            if (m_SearchField == null)
            {
                m_SearchField = new SearchField();
            }

            m_Runtime.ProjectSettings.Tags.TagSelectionChanged += TagSelectionChanged;

            m_TimeOfLastAutoConnectStart = DateTime.Now;
            m_Runtime.Update            += OnUpdate;

            m_FinishedAutoselectingPackage = false;
            AndroidLogcatInternalLog.Log("Package: {0}, Auto select: {1}", PlayerSettings.applicationIdentifier, AutoSelectPackage);

            m_StatusBar = new AndroidLogcatStatusBar();

            m_Runtime.Settings.OnSettingsChanged += OnSettingsChanged;

            m_MemoryViewer = new AndroidLogcatMemoryViewer(this, m_Runtime);

            // Can't apply settings here, apparently EditorStyles aren't initialized yet.
            m_ApplySettings = true;

            m_Runtime.DeviceQuery.Clear();
            m_Runtime.DeviceQuery.DeviceSelected += OnSelectedDevice;

            // Since Runtime.OnDisable can be called earlier than this window OnClose, we must ensure the order
            m_Runtime.Closing += OnDisable;
        }
 internal void OnDisable()
 {
     if (m_Runtime != null)
     {
         m_Runtime.Shutdown();
         m_Runtime = null;
     }
 }
        private void Initialize()
        {
            if (m_Runtime != null)
            {
                return;
            }

            m_Runtime = new AndroidLogcatRuntime();
            m_Runtime.Initialize();
        }
Beispiel #6
0
 private void OnEnable()
 {
     m_Runtime = AndroidLogcatManager.instance.Runtime;
     if (string.IsNullOrEmpty(m_Text))
     {
         var placeholder = new StringBuilder();
         placeholder.AppendLine("Copy paste log with address and click Resolve Stackraces");
         placeholder.AppendLine("For example:");
         placeholder.AppendLine("2019-05-17 12:00:58.830 30759-30803/? E/CRASH: \t#00  pc 002983fc  /data/app/com.mygame==/lib/arm/libunity.so");
         m_Text = placeholder.ToString();
     }
 }
        public AndroidLogcat(AndroidLogcatRuntimeBase runtime, ADB adb, IAndroidLogcatDevice device, int packagePid, Priority priority, string filter, bool filterIsRegex, string[] tags)
        {
            this.m_Runtime         = runtime;
            this.adb               = adb;
            this.m_Device          = device;
            this.m_PackagePid      = packagePid;
            this.m_MessagePriority = priority;
            this.m_FilterIsRegex   = filterIsRegex;
            InitFilterRegex(filter);
            this.m_Tags = tags;

            LogEntry.SetTimeFormat(m_Device.SupportYearFormat ? LogEntry.kTimeFormatWithYear : LogEntry.kTimeFormatWithoutYear);
        }
        void OnEnable()
        {
            if (m_Runtime == null)
            {
                m_Runtime = AndroidLogcatManager.instance.Runtime;
            }
            m_IpString   = EditorPrefs.GetString(kAndroidLogcatLastIp, "");
            m_PortString = EditorPrefs.GetString(kAndroidLogcatLastPort, "5555");

            m_Runtime.DeviceQuery.DevicesUpdated += DevicesUpdated;

            // Disable progress bar just in case, if we have a stale process hanging where we peform adb connect
            EditorUtility.ClearProgressBar();
        }
        private void Initialize()
        {
            if (!AndroidBridge.AndroidExtensionsInstalled)
            {
                return;
            }

            if (m_Runtime != null)
            {
                return;
            }

            m_Runtime = new AndroidLogcatRuntime();
            m_Runtime.Initialize();
        }
        public AndroidLogcatMemoryViewer(EditorWindow parent, AndroidLogcatRuntimeBase runtime)
        {
            m_Parent   = parent;
            m_Runtime  = runtime;
            m_Material = (Material)EditorGUIUtility.LoadRequired("SceneView/HandleLines.mat");
            m_State    = m_Runtime.ProjectSettings.MemoryViewerState;

            for (int i = 0; i < kMaxEntries; i++)
            {
                m_Entries[i] = new AndroidMemoryStatistics();
            }

            m_RequestsInQueue = 0;

            /*
             * // For Debugging purposes
             * for (int i = 0; i < kMaxEntries; i++)
             * {
             *  InjectFakeMemoryStatistics((int)(UnityEngine.Random.value * k16MB * 2.0f));
             * }
             * //**/

            m_SplitterStart    = 0;
            m_SplitterDragging = SplitterDragging.None;

            m_MemoryTypeColors[MemoryType.NativeHeap]   = Color.red;
            m_MemoryTypeColors[MemoryType.JavaHeap]     = Color.yellow;
            m_MemoryTypeColors[MemoryType.Code]         = Color.blue;
            m_MemoryTypeColors[MemoryType.Stack]        = Color.cyan;
            m_MemoryTypeColors[MemoryType.Graphics]     = Color.green;
            m_MemoryTypeColors[MemoryType.PrivateOther] = Color.grey;
            m_MemoryTypeColors[MemoryType.System]       = Color.magenta;
            m_MemoryTypeColors[MemoryType.Total]        = Color.white;
            ClearEntries();
            ValidateSettings();
        }
Beispiel #11
0
 public AndroidLogcatSettingsProvider(string path, SettingsScope scope)
     : base(path, scope)
 {
     m_Runtime   = AndroidLogcatManager.instance.Runtime;
     m_RegexList = new AndroidLogcatRegexList(Settings.StacktraceResolveRegex, m_Runtime);
 }
 internal AndroidLogcatDeviceQueryBase(AndroidLogcatRuntimeBase runtime)
 {
     m_Runtime = runtime;
 }
 internal AndroidLogcatDeviceQuery(AndroidLogcatRuntimeBase runtime)
     : base(runtime)
 {
     m_TimeOfLastDeviceListUpdate = DateTime.Now;
 }
 public AndroidLogcatRegexList(List <ReordableListItem> dataSource, AndroidLogcatRuntimeBase runtime) :
     base(dataSource)
 {
     ShowResetGUI = true;
     m_Runtime    = runtime;
 }
 internal AndroidLogcatDispatcher(AndroidLogcatRuntimeBase runtime)
 {
     m_Runtime = runtime;
     m_AsyncOperationsExecuted = 0;
 }
        public static void Show(AndroidLogcatRuntimeBase runtime, Rect screenRect)
        {
            AndroidLogcatIPWindow win = EditorWindow.GetWindow <AndroidLogcatIPWindow>(true, "Other connection options");

            win.position = new Rect(screenRect.x, screenRect.y, 700, 200);
        }