Merge "Unregister hotspot receiver in TetherService."
This commit is contained in:
committed by
Android (Google) Code Review
commit
95c89da244
@@ -1,5 +1,5 @@
|
||||
|
||||
package com.android.settings;
|
||||
package com.android.settings.wifi.tether;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings;
|
||||
package com.android.settings.wifi.tether;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlarmManager;
|
||||
@@ -167,11 +167,16 @@ public class TetherService extends Service {
|
||||
SharedPreferences prefs = getSharedPreferences(PREFS, MODE_PRIVATE);
|
||||
prefs.edit().putString(KEY_TETHERS, tethersToString(mCurrentTethers)).commit();
|
||||
|
||||
unregisterReceivers();
|
||||
if (DEBUG) Log.d(TAG, "Destroying TetherService");
|
||||
unregisterReceiver(mReceiver);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
private void unregisterReceivers() {
|
||||
unregisterReceiver(mReceiver);
|
||||
mHotspotReceiver.unregister();
|
||||
}
|
||||
|
||||
private void removeTypeAtIndex(int index) {
|
||||
mCurrentTethers.remove(index);
|
||||
// If we are currently in the middle of a check, we may need to adjust the
|
Reference in New Issue
Block a user