public override void OnAccessibilityEvent(AccessibilityEvent e)
        {
            Instance = this;

            if (e == null)
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(e.PackageName))
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(e.ClassName))
            {
                return;
            }

            var status = RunPackageNames?.Invoke().Any(x => x == e.PackageName) ?? false;

            foreach (var item in AutoGlobal.Instance?.Events)
            {
                item.Event(this, e);
            }
        }
        protected override void OnServiceConnected()
        {
            Instance = this;
            _enabled = _lock.NewCondition();
            base.OnServiceConnected();
            _lock.Lock();
            _enabled.SignalAll();
            _lock.Unlock();

            var autoGlobal = AutoGlobal.Instance;

            if (autoGlobal != null && autoGlobal.Context != null)
            {
                Toast.MakeText(autoGlobal.Context, "服务启动成功", ToastLength.Long).Show();
            }
        }
Esempio n. 3
0
        protected override void OnServiceConnected()
        {
            Instance = this;
            _enabled = _lock.NewCondition();
            base.OnServiceConnected();
            _lock.Lock();
            _enabled.SignalAll();
            _lock.Unlock();

            var autoGlobal = AutoGlobal.Instance;

            if (autoGlobal?.Context != null)
            {
                Toast.MakeText(autoGlobal.Context, "服务启动成功", ToastLength.Long).Show();
            }

            var i = new Intent();

            i.SetClass(this, typeof(MainActivity));
            StartActivity(i);
        }
 public override void OnDestroy()
 {
     Instance = null;
     base.OnDestroy();
 }