summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/HotspotOffReceiver.java
diff options
context:
space:
mode:
authorHyejin <hyejin.kim@lge.com>2015-09-10 23:26:53 -0700
committerVineeta Srivastava <vsrivastava@google.com>2015-09-14 16:04:52 -0700
commit5565b5cd7537e9360e6382507a45cf5e091a5108 (patch)
tree0be72d315a75d786000892de8c41218b7afadee3 /src/com/android/settings/HotspotOffReceiver.java
parentcda53c5dc2c6a2c01dfd5db278a7899dd868da7d (diff)
downloadpackages_apps_Settings-5565b5cd7537e9360e6382507a45cf5e091a5108.zip
packages_apps_Settings-5565b5cd7537e9360e6382507a45cf5e091a5108.tar.gz
packages_apps_Settings-5565b5cd7537e9360e6382507a45cf5e091a5108.tar.bz2
Fix IndexOutOfBoundsException while silent provisioning check
- If hostpot off, we receive result through HotspotOffReceiver. Sometimes, during provisioning, we're used to receive this. In this case, we don't care. After provisioning, we'll receive the intent again. - In stress test, index is sometimes invalid, equals to mCurrentTethers.size(). So, when provisioning, We check whether index is valid or not. BUG=23528220 Change-Id: I70f35e045042c6c81b1db03e2a44cd41d3e7437f
Diffstat (limited to 'src/com/android/settings/HotspotOffReceiver.java')
-rw-r--r--src/com/android/settings/HotspotOffReceiver.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/settings/HotspotOffReceiver.java b/src/com/android/settings/HotspotOffReceiver.java
index 06ced1f..f3c3fee 100644
--- a/src/com/android/settings/HotspotOffReceiver.java
+++ b/src/com/android/settings/HotspotOffReceiver.java
@@ -5,6 +5,7 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.wifi.WifiManager;
+import android.util.Log;
import com.android.settingslib.TetherUtil;
@@ -14,11 +15,15 @@ import com.android.settingslib.TetherUtil;
*/
public class HotspotOffReceiver extends BroadcastReceiver {
+ private static final String TAG = "HotspotOffReceiver";
+ private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
+
@Override
public void onReceive(Context context, Intent intent) {
if (WifiManager.WIFI_AP_STATE_CHANGED_ACTION.equals(intent.getAction())) {
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
if (wifiManager.getWifiApState() == WifiManager.WIFI_AP_STATE_DISABLED) {
+ if (DEBUG) Log.d(TAG, "TetherService.cancelRecheckAlarmIfNecessary called");
// The hotspot has been turned off, we don't need to recheck tethering.
TetherService.cancelRecheckAlarmIfNecessary(context, TetherUtil.TETHERING_WIFI);
}