| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * This file is part of Adblock Plus <https://adblockplus.org/>, | 2  * This file is part of Adblock Plus <https://adblockplus.org/>, | 
| 3  * Copyright (C) 2006-present eyeo GmbH | 3  * Copyright (C) 2006-present eyeo GmbH | 
| 4  * | 4  * | 
| 5  * Adblock Plus is free software: you can redistribute it and/or modify | 5  * Adblock Plus is free software: you can redistribute it and/or modify | 
| 6  * it under the terms of the GNU General Public License version 3 as | 6  * it under the terms of the GNU General Public License version 3 as | 
| 7  * published by the Free Software Foundation. | 7  * published by the Free Software Foundation. | 
| 8  * | 8  * | 
| 9  * Adblock Plus is distributed in the hope that it will be useful, | 9  * Adblock Plus is distributed in the hope that it will be useful, | 
| 10  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
| 11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
| 12  * GNU General Public License for more details. | 12  * GNU General Public License for more details. | 
| 13  * | 13  * | 
| 14  * You should have received a copy of the GNU General Public License | 14  * You should have received a copy of the GNU General Public License | 
| 15  * along with Adblock Plus.  If not, see <http://www.gnu.org/licenses/>. | 15  * along with Adblock Plus.  If not, see <http://www.gnu.org/licenses/>. | 
| 16  */ | 16  */ | 
| 17 | 17 | 
| 18 package org.adblockplus.sbrowser.contentblocker; | 18 package org.adblockplus.sbrowser.contentblocker; | 
| 19 | 19 | 
|  | 20 import org.adblockplus.sbrowser.contentblocker.engine.DownloadJobService; | 
| 20 import org.adblockplus.sbrowser.contentblocker.engine.Engine; | 21 import org.adblockplus.sbrowser.contentblocker.engine.Engine; | 
| 21 import org.adblockplus.sbrowser.contentblocker.engine.EngineManager; | 22 import org.adblockplus.sbrowser.contentblocker.engine.EngineManager; | 
| 22 import org.adblockplus.adblockplussbrowser.R; | 23 import org.adblockplus.adblockplussbrowser.R; | 
| 23 import org.adblockplus.sbrowser.contentblocker.util.ConnectivityUtils; | 24 import org.adblockplus.sbrowser.contentblocker.util.ConnectivityUtils; | 
| 24 import org.adblockplus.sbrowser.contentblocker.util.SharedPrefsUtils; | 25 import org.adblockplus.sbrowser.contentblocker.util.SharedPrefsUtils; | 
| 25 | 26 | 
| 26 import android.app.AlertDialog; | 27 import android.app.AlertDialog; | 
| 27 import android.app.Fragment; | 28 import android.app.Fragment; | 
| 28 import android.app.ProgressDialog; | 29 import android.app.ProgressDialog; | 
| 29 import android.content.DialogInterface; | 30 import android.content.DialogInterface; | 
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 64   @Override | 65   @Override | 
| 65   protected void onStart() | 66   protected void onStart() | 
| 66   { | 67   { | 
| 67     this.dialogTitleResId = R.string.initialization_title; | 68     this.dialogTitleResId = R.string.initialization_title; | 
| 68     this.dialog = ProgressDialog.show(this, | 69     this.dialog = ProgressDialog.show(this, | 
| 69         this.getString(this.dialogTitleResId), | 70         this.getString(this.dialogTitleResId), | 
| 70         this.getString(R.string.initialization_message)); | 71         this.getString(R.string.initialization_message)); | 
| 71     super.onStart(); | 72     super.onStart(); | 
| 72     SharedPrefsUtils.registerOnSharedPreferenceChangeListener(this, listener); | 73     SharedPrefsUtils.registerOnSharedPreferenceChangeListener(this, listener); | 
| 73     EngineManager.getInstance().retrieveEngine(this, this); | 74     EngineManager.getInstance().retrieveEngine(this, this); | 
|  | 75     startService(new Intent(this, DownloadJobService.class)); | 
| 74   } | 76   } | 
| 75 | 77 | 
| 76   @Override | 78   @Override | 
| 77   protected void onStop() | 79   protected void onStop() | 
| 78   { | 80   { | 
| 79     super.onStop(); | 81     super.onStop(); | 
| 80     SharedPrefsUtils.unregisterOnSharedPreferenceChangeListener(this, listener); | 82     SharedPrefsUtils.unregisterOnSharedPreferenceChangeListener(this, listener); | 
|  | 83     stopService(new Intent(this, DownloadJobService.class)); | 
| 81     this.dismissDialog(); | 84     this.dismissDialog(); | 
| 82   } | 85   } | 
| 83 | 86 | 
| 84   @Override | 87   @Override | 
| 85   protected void onDestroy() | 88   protected void onDestroy() | 
| 86   { | 89   { | 
| 87     EngineManager.getInstance().removeOnEngineCreatedCallback(this); | 90     EngineManager.getInstance().removeOnEngineCreatedCallback(this); | 
| 88     super.onDestroy(); | 91     super.onDestroy(); | 
| 89   } | 92   } | 
| 90 | 93 | 
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 308       else if (getString(R.string.key_application_activated).equals(key)) | 311       else if (getString(R.string.key_application_activated).equals(key)) | 
| 309       { | 312       { | 
| 310         if (dialogTitleResId == R.string.setup_dialog_title) | 313         if (dialogTitleResId == R.string.setup_dialog_title) | 
| 311         { | 314         { | 
| 312           dismissDialog(); | 315           dismissDialog(); | 
| 313         } | 316         } | 
| 314       } | 317       } | 
| 315     } | 318     } | 
| 316   }; | 319   }; | 
| 317 } | 320 } | 
| OLD | NEW | 
|---|