Merge "Unregister hotspot receiver in TetherService."

This commit is contained in:
TreeHugger Robot
2018-01-19 22:01:18 +00:00
committed by Android (Google) Code Review
5 changed files with 35 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
package com.android.settings;
package com.android.settings.wifi.tether;
import android.content.BroadcastReceiver;
import android.content.Context;

View File

@@ -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