From 5565b5cd7537e9360e6382507a45cf5e091a5108 Mon Sep 17 00:00:00 2001 From: Hyejin Date: Thu, 10 Sep 2015 23:26:53 -0700 Subject: 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 --- src/com/android/settings/HotspotOffReceiver.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/com/android/settings/HotspotOffReceiver.java') diff --git a/src/com/android/settings/HotspotOffReceiver.java b/src/com/android/settings/HotspotOffReceiver.java index 06ced1f62..f3c3feede 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); } -- cgit v1.2.3