[1/2] Add triggers to change profile based on AP

Add data structure mWifiTriggers to store triggers per profile.
Add network change listener to switch to profile

Change-Id: I97e360d7783d3b0e2bbd70fe7a9a866d8c0fa7cd
Profiles: Fix turning bluetooth on/off when its in intermediate state

Change-Id: I09213c987580f47a6c3618edb469edabda96230c
[2/2] Add bluetooth triggers to profiles

Change-Id: I374cc93364c88b8b29c88345deccf297234ff624
AssetRedirectionManager: Accept redirections only for whitelisted resource types

Change-Id: Idf1ea739a81719b6a196f0114c9fc3b7c7ff428c
Add 2G/3G option to profile connections (1/2)

Change-Id: I55d0768c9eeecb7dcce97c6d6390e339d678d0c4
Fix lock screen timeouts

- Currently, if slide lock delays are enabled and then user switches to a secure lock screen, the slide delays were still being utilized
- This patch fixes the logic around whether to utilize the slide delay setting

Change-Id: I44d8b8dcb04468ca069c7967a753038090d34133
(12) Framework: Forward port the ability to enable/disable keyguard with Profiles

This commit adds a few missing pieces needed to support the bypassing of the
keyguard via a profile

Change-Id: I557b80e6de62687b05c434a31083c331127a0398

Conflicts:
	policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java
Don't consider input restricted when the lockscreen is disabled by an
app.

Fixes the secure lockscreen occasionally appearing when disabling the
lockscreen via tile.

Change-Id: I078584d0235c1cc958f89ce12ddf3cc1117a5687
When DPM is updated while lock screen is inhibited, don't
unconditionally enable lock screen.

Change-Id: Iab2af06eb8e41fbcfc6adfbeb5b42a9bbf446fe9
Fix deadlock of WebViewCoreThread

There was a deadlock in destroy process.
Investigation showed that WebViewCoreThread is waiting some
callbacks but in this case WebViewCoreThread can not resume
itself not to call notify method.

Flow:
1. CallbackProxy.sendMessageToUiThreadSync
2. WebViewClassic.destroy()
3. CallbackProxy.blockMessages()
4. CallbackProxy.handleMessage is called via MainThread
5. The WebViewCoreThread deadlock is occured.

The cases we have to call notify method are followings.
OVERRIDE_URL
CREATE_WINDOW
SAVE_PASSWORD
NOTIFY
OPEN_FILE_CHOOSER
JS_ALERT
JS_CONFIRM
JS_PROMPT
JS_UNLOAD
JS_TIMEOUT

Change-Id: I9d95ae500bf6338d77b32b5fa15de7cff5720d0f
Fixed incorrect calculation of dirty invalidation area

Padding was already taken into consideration before calling
invalidateDrawable in ProgressBar.

Change-Id: Id7f23bd15bb19e2294c07adb2acb397100ea97e8
Avoid adding FORWARD_LOCK flag to an updated system app

Consider the following case:
1. An app exists in /system/app or /vendor/app. (i.e, it's a system app)
2. If the app would be updated as a forward-lock app by downloading from
   market(google play), then it would be installed in /data/app-private.
3. Moreover, if it would be updated by the whole system image (i.e, FOTA
   or something like that), then the app would be applied a FORWARD_LOCK
   flag.

The app SHOULD NOT have a FORWARD_LCOK flag. Because the resource path
of such app does not refer to the proper resources to access.

Change-Id: I0750f69a93a3115f4201029796b598507de3555f
Fix misspelling of getLteSignalStrenght.

Change to getLteSignalStrength.

Change-Id: Ie2acec9e01af0e64a61902383f06729a7cee1975
Avoid unnecessary FindClass("java/lang/String").

Use previously retrieved global reference instead.
Check for NULL after creating the global reference.

Change-Id: I21670d2ef0f63ddb5801dd21e7e56359e5519479
Profile: Filter on NETWORK_STATE_CHANGED instead of SUPPLICANT_STATE_CHANGED

For more reliable network change detection use NETWORK_STATE_CHANGED
instead of SUPPLICANT_STATE_CHANGED

Only set profile when profile actually changed.
Use getWifiSsid instead of getSSID so we dont have to strip double
quotes ourselves, add null pointer exception check because function can
now be called when WiFi is off.

Change-Id: I2b4ea65fdb484edb39a14725c648d9ab0d5d36fb
Also backup profiles file via backup manager.

Change-Id: Id70cb1bce15b7de127e4291e9482ab3fd7270f9f
Port wimax support changes from CM9.

- Register WiMax service in ContextImpl (fixes 4G toggle).
- Fix misdocumented EXTRA_4G_STATE in WimaxManagerConstants.
- Share wimaxClassLoader between WimaxHelper and ConnectivityService.
- Add ACCESS_4G_RADIO_DISABLE, ACCESS_4G_STATE, and CHANGE_4G_STATE
  permissions to SystemUI.

Note that WimaxManagerConstants was previously misdocumented, confabulating
the lookup key EXTRA_4G_STATE ("4g_state") with EXTRA_WIMAX_STATUS
("wimax_status"), which no longer exists.  This is also fixed.

Change-Id: I4f5973e7bd2ff4c860036df0f38589b34ad72b49
SystemUI: Request CHANGE_NETWORK_MODE permission

com.android.phone.CHANGE_NETWORK_MODE permission is required for the
network toggle to function properly

Change-Id: I88a6f6705553fcb08bee5e8308e89395a4749e4f
systemui: Add CONNECTIVITY_INTERNAL permission

 * SystemUI needs to be able to list interfaces if tethering is in use
   and we ask for a second tethering path to be set up (BT+USB, etc).
 * Add permission to stop exceptions in the framework and enable
   tethering thru multiple paths.

Change-Id: If7a65c31557dc2f0451f0612fb109f61e8056368
more getLTEstrength typos

Change-Id: Ic434841b95b7bfc7633d7c0bb5df1f5b80657ab4