Wifi: Get the list of supported channels

Get the list of supported channels/frequencies from wpa_supplicant and provide
them thru WifiManager.getSupportedChannels();

One channel is represented thru the class WifiChannel which includes channel
number, frequency in MHz and a flag if IBSS mode is allowed on this channel.

Like isIbssSupported() we can only expect a result after WIFI_STATE_ENABLED has
been reached.

Change-Id: I9fc34642b9a0047f6871b180a3a7a69d47b7e2ff
wifi: Fix StringIndexOutOfBoundsException for incorrectly encoded SSIDs

If the last character of a SSID is a unescaped backslash then WifiSsid
convertToBytes() will throw a StringIndexOutOfBoundsException and takes the
whole ROM down.

The issue was reported by andreip in the HTC One X XDA thread. His SSID was
set to "/ Andrew \".

04-10 21:33:54.265 E/AndroidRuntime(10479): *** FATAL EXCEPTION IN SYSTEM PROCESS: WifiStateMachine
04-10 21:33:54.265 E/AndroidRuntime(10479): java.lang.StringIndexOutOfBoundsException: length=10; index=10
04-10 21:33:54.265 E/AndroidRuntime(10479):     at android.net.wifi.WifiSsid.convertToBytes(WifiSsid.java:89)
04-10 21:33:54.265 E/AndroidRuntime(10479):     at android.net.wifi.WifiSsid.createFromAsciiEncoded(WifiSsid.java:54)
04-10 21:33:54.265 E/AndroidRuntime(10479):     at android.net.wifi.WifiStateMachine.setScanResults(WifiStateMachine.java:1522)
04-10 21:33:54.265 E/AndroidRuntime(10479):     at android.net.wifi.WifiStateMachine.access$7100(WifiStateMachine.java:103)
04-10 21:33:54.265 E/AndroidRuntime(10479):     at android.net.wifi.WifiStateMachine$SupplicantStartedState.processMessage(WifiStateMachine.java:2511)
04-10 21:33:54.265 E/AndroidRuntime(10479):     at com.android.internal.util.StateMachine$SmHandler.processMsg(StateMachine.java:905)
04-10 21:33:54.265 E/AndroidRuntime(10479):     at com.android.internal.util.StateMachine$SmHandler.handleMessage(StateMachine.java:760)
04-10 21:33:54.265 E/AndroidRuntime(10479):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 21:33:54.265 E/AndroidRuntime(10479):     at android.os.Looper.loop(Looper.java:137)
04-10 21:33:54.265 E/AndroidRuntime(10479):     at android.os.HandlerThread.run(HandlerThread.java:60)

Change-Id: I8273decacfffea4e4cae3bb957c925833dab09e2
Correct executable bit for source files

Many media files and source code files were marked as executable in Git.
Remove those.

Also a shell script and python script were not marked as executable.

Change-Id: Ieb51bafb46c895a21d2e83696f5a901ba752b2c5
Signed-off-by: Chirayu Desai <cdesai@cyanogenmod.org>
SystemUI: fix memory leaks

ContentObservers are being registered without being unregistered,
causing old objects not to be garbage collected. This causes memory
leak if the classes are destroyed and recreated throughout the
device's uptime.

SearchPanelView is recreated every time the screen is turned on.
StatusBarIconView is created every time a notification is triggered.

JIRA: CYAN-650
Change-Id: Iabd3221fc2b0c848396af1790fd09424be602e7e

Conflicts:
	packages/SystemUI/src/com/android/systemui/SearchPanelView.java
	packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
Fix Tablet UI WiFi Text

If custom carrier label was selected, it was overwriting the
wifi SSID display on Tablet Notification Title.

Change-Id: Iab647759d64c47ec47c9a093be36e58e7cbdd345
Signed-off-by: Zaphod <mwilson@acesappraisal.com>
Fix TabUI Notification icon layout.

Notifications were getting cut-off on bottom when System bar
re-sized.

Change-Id: I8268aa21ec0ca1c1601940f3f2c09b8eed9d47b8
Signed-off-by: Zaphod <mwilson@acesappraisal.com>
FW: Fix AwesomeAction constants

Fixes 3 'Blank' entries in NavBar/Custom Toggle actions.
This was due to someone (SteveSpear!! :))  Adding actions
to the AwesomeActions variables without putting appropriate
string & drawable returns.

Change-Id: I8d12808337152b6010be6deb9a7d8984e6980a05
Signed-off-by: Zaphod <mwilson@acesappraisal.com>
Fix Photosphere/Camera FCs

Photosphere is setting a few parameters "blindly"
while the API says it should check the device capabilities first.
On TF101 the camera HAL doesn't handle FLASH_MODE & SCENE_MODE
and so it sends the required RuntimeException for these which makes PS to FC

=> check device capabilities & ignore these 2 parameters if the device doesn't support them.

Change-Id: I4848f6f144c5b1f56238b7d3893020483f434dbd
Merge "SystemUI: fix memory leaks" into jb-mr1
SystemUI: partial revert of 3f72751c, we already had the fix in SearchPanelView

Signed-off-by: Gergely Szell (sethyx) <szell@hu.ibm.com>

Change-Id: I05d9b000638c9ea0083a8a95cb199811a89164b4
Merge "Fix Photosphere/Camera FCs" into jb-mr1
Merge "Fix Tablet UI WiFi Text" into jb-mr1
Merge "Fix TabUI Notification icon layout." into jb-mr1
Merge "FW: Fix AwesomeAction constants" into jb-mr1
SystemUI: animate transparency changes

Change-Id: I597b245b2d98ae42118efc1ba7ccb837edfdbea9
Signed-off-by: Roman Birg <romanbirg@gmail.com>
Remove trailing tab

Change-Id: I5b715bd014db2b82395c7a3cd91f7381c83667e7
Merge "SystemUI: animate transparency changes" into jb-mr1
Merge remote-tracking branch 'upstream/jb-mr1' into jb-mr1