예제 #1
0
        public override void OnReceive(Context context, Intent intent)
        {
            PowerManager pPowerManager = (PowerManager)context.GetSystemService(Context.PowerService);

            PowerManager.WakeLock pWakeLock = pPowerManager.NewWakeLock(WakeLockFlags.Partial, "GC_NOTIFS");

            pWakeLock.Acquire();

            if (Master.GetSetting("notifications") == "on")
            {
                this.OnWakeInitializationProtocol();

                foreach (string sLine in File.ReadAllLines(Master.GetBaseDir() + "_clans.dat").ToList())
                {
                    string sClan     = sLine.Substring(0, sLine.IndexOf("|"));
                    string sUserName = sLine.Substring(sLine.IndexOf("|") + 1);
                    this.CheckServerNotifications(context, sClan, sUserName);
                }
            }

            pWakeLock.Release();
        }