Пример #1
0
        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);
            }
        }
Пример #2
0
        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();
            }
        }
Пример #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);
        }
Пример #4
0
 public override void OnDestroy()
 {
     Instance = null;
     base.OnDestroy();
 }