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 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
FW : Screen Sizing for TabUI when HiddenNav Enabled

Hidden Nav is not available to Tablets, but it could be
selected in RC for Phablet/Phone.  If UI then switched
to Tablet, PhoneWindowManager was calculating window sizes
as if NavHide was on.

Change-Id: Ib700fc944dcfb0ad42e7c651ee415f539ed5d134
Signed-off-by: Zaphod <mwilson@acesappraisal.com>
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
FW: Fix Potential FC on Hiding NavBar

If you touched/swiped the NavBar just as it was
trying to hide, you could get a FC.  This
catches those errors and just puts the status
back into hidden mode.

Change-Id: I03220d10d23b94716c28b748defcb39a525a2aa7
Signed-off-by: Zaphod <mwilson@acesappraisal.com>
SystemUI: animate transparency changes

Change-Id: I597b245b2d98ae42118efc1ba7ccb837edfdbea9
Signed-off-by: Roman Birg <romanbirg@gmail.com>
SystemUI: Fix blank Navring on boot,

Need to setDrawables peeps....

better...

Change-Id: I17b9d1f3652e9dbbb75d4106c6197aaaae35c09e
FW:  Bring Transparency to Tablet UI {WIP}

This will enable Transparency settings in TabletUI.

Also this will fix some quirks introduced by the fading transparency changes.

Change-Id: I89b4e97f70af2e9ef5245524c7bd765293ef044b
Signed-off-by: Zaphod <mwilson@acesappraisal.com>

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java

Signed-off-by: iceandfire <arhamjamal@gmail.com>
Fix Signal toggle layout

Change-Id: I56c298a7e2ce326e8bfacd1aa2702466a2f4cefc
Signed-off-by: sethyx <sethyx@gmail.com>
SystemUI: filter certain toggles

PS2: Also add wifi tether filter based on telephony

Change-Id: I8523ebc78d2d6f0ffdb44ad917cfabd94c9806b6
Signed-off-by: Roman Birg <romanbirg@gmail.com>

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/toggles/ToggleManager.java

Signed-off-by: iceandfire <arhamjamal@gmail.com>
SystemUI: RAM bar view optimizations

findViewById() was being called every time updateSettings()
was being called. Instead, let's instantiate them once, and
remove calls to updateSettings() since it will be called
on its own when the setting values change.

Change-Id: Iaa02343caccb615921219be2a56b3bac4f3263b9
Signed-off-by: Roman Birg <romanbirg@gmail.com>
SystemUI: fix recents minimization animation

Splitting up the buttons into each class is cute,
but it only seemed to complicate its interactions.
The instantiation was wrong before anyways and
onTouchListener was never being registered
(which is why the animation was wonky).

Change-Id: I4194569aaf0099754852d5cfb83f308f3271008b
Signed-off-by: Roman Birg <romanbirg@gmail.com>
FW: Settings.system get and put arraylist methods

Change-Id: I304b324d48832e18a9468308cffee41f4d1114cd
Signed-off-by: Stevespear426 <stephen.k.spear@gmail.com>

Conflicts:
	core/java/android/provider/Settings.java

Signed-off-by: iceandfire <arhamjamal@gmail.com>
Battery: Solid green when battery is full and introduce 4th stage

* Solid green when battery is full
* Introduce 4th step in colors which includes 69-99%
	 0-14: red
	15-69: orange
	70-99: yellow
          100: solid green

Change-Id: I24af9bb012744ea15d411c2aa42afe9388f2a97e
Signed-off-by: bmc08gt <bmc08gt.teamb00sted@gmail.com>
FW: Method for exluding options from navbar.

Change-Id: Icd6d51fe95a2dabd20c7c138d0b31159d4cd78ff
Signed-off-by: Stevespear426 <stephen.k.spear@gmail.com>