Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a97ad42 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android (Google) Code Review
Browse files

Merge "Fix soft Ap handling on system restart" into honeycomb

parents c7816cd6 0c7e1645
Loading
Loading
Loading
Loading
+18 −8
Original line number Diff line number Diff line
@@ -61,7 +61,6 @@ import android.os.WorkSource;
import android.provider.Settings;
import android.util.EventLog;
import android.util.Log;
import android.util.Slog;
import android.app.backup.IBackupManager;
import android.bluetooth.BluetoothAdapter;
import android.content.BroadcastReceiver;
@@ -1672,10 +1671,18 @@ public class WifiStateMachine extends HierarchicalStateMachine {
                                    mInterfaceName,
                                    SOFTAP_IFACE);
                    } catch (Exception e) {
                        Log.e(TAG, "Exception in startAccessPoint()");
                        Log.e(TAG, "Exception in softap start " + e);
                        try {
                            nwService.stopAccessPoint();
                            nwService.startAccessPoint((WifiConfiguration) message.obj,
                                    mInterfaceName,
                                    SOFTAP_IFACE);
                        } catch (Exception ee) {
                            Log.e(TAG, "Exception during softap restart : " + ee);
                            sendMessage(obtainMessage(CMD_UNLOAD_DRIVER, WIFI_AP_STATE_FAILED, 0));
                            break;
                        }
                    }
                    Log.d(TAG, "Soft AP start successful");
                    setWifiApState(WIFI_AP_STATE_ENABLED);
                    transitionTo(mSoftApStartedState);
@@ -2824,14 +2831,17 @@ public class WifiStateMachine extends HierarchicalStateMachine {
                                    mInterfaceName,
                                    SOFTAP_IFACE);
                    } catch(Exception e) {
                        Log.e(TAG, "Exception in nwService during soft AP set");
                        Log.e(TAG, "Exception in softap set " + e);
                        try {
                            nwService.stopAccessPoint();
                            nwService.startAccessPoint((WifiConfiguration) message.obj,
                                    mInterfaceName,
                                    SOFTAP_IFACE);
                        } catch (Exception ee) {
                            Slog.e(TAG, "Could not stop AP, :" + ee);
                        }
                            Log.e(TAG, "Could not restart softap after set failed " + ee);
                            sendMessage(obtainMessage(CMD_UNLOAD_DRIVER, WIFI_AP_STATE_FAILED, 0));
                        }
                    }
                    break;
                /* Fail client mode operation when soft AP is enabled */
                case CMD_START_SUPPLICANT: