@@ -0,0 +1,2507 @@
+package com.breadwallet.tools.services;%0A%0Aimport android.app.Service;%0Aimport android.content.Intent;%0Aimport android.os.IBinder;%0A%0A/**%0A * BreadWallet%0A * %3Cp/%3E%0A * Created by Mihail Gutan on %3Cmihail@breadwallet.com%3E 6/27/17.%0A * Copyright (c) 2017 breadwallet LLC%0A * %3Cp/%3E%0A * Permission is hereby granted, free of charge, to any person obtaining a copy%0A * of this software and associated documentation files (the %22Software%22), to deal%0A * in the Software without restriction, including without limitation the rights%0A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0A * copies of the Software, and to permit persons to whom the Software is%0A * furnished to do so, subject to the following conditions:%0A * %3Cp/%3E%0A * The above copyright notice and this permission notice shall be included in%0A * all copies or substantial portions of the Software.%0A * %3Cp/%3E%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN%0A * THE SOFTWARE.%0A */%0Apublic class NetworkChangeService extends Service %7B%0A%0A    /** indicates how to behave if the service is killed */%0A    int mStartMode;%0A%0A    /** interface for clients that bind */%0A    IBinder mBinder;%0A%0A    /** indicates whether onRebind should be used */%0A    boolean mAllowRebind;%0A%0A    /** Called when the service is being created. */%0A    @Override%0A    public void onCreate() %7B%0A%0A    %7D%0A%0A    /** The service is starting, due to a call to startService() */%0A    @Override%0A    public int onStartCommand(Intent intent, int flags, int startId) %7B%0A        return mStartMode;%0A    %7D%0A%0A    /** A client is binding to the service with bindService() */%0A    @Override%0A    public IBinder onBind(Intent intent) %7B%0A        return mBinder;%0A    %7D%0A%0A    /** Called when all clients have unbound with unbindService() */%0A    @Override%0A    public boolean onUnbind(Intent intent) %7B%0A        return mAllowRebind;%0A    %7D%0A%0A    /** Called when a client is binding to the service with bindService()*/%0A    @Override%0A    public void onRebind(Intent intent) %7B%0A%0A    %7D%0A%0A    /** Called when The service is no longer used and is being destroyed */%0A    @Override%0A    public void onDestroy() %7B%0A%0A    %7D%0A%7D%0A

create a NetworkChangeService to run when state has changed