In isMobileOk don't execute finally if mobile data is not supported.

Move the early return outside the try {} finally so we don't call
setEnableFailFastMobileData(DctContants.DISABLED). Otherwise
referencing counting is wrong and an exception is thrown in DcTrackerBase.

Bug: 10304904
Change-Id: I5ba5121e473bada9f3daa8d6f3d3577cec8212fc
DO NOT MERGE: MDST is not ready until connected to DcTracker.

When the system becomes loaded the PhoneApp can be delayed
significantly and a call to setEnableFailFastMobileData may not
occur because the channel between the MobileDataStateTracker (MDST)
and DcTracker (DCT) is not connected.

Solution: Add a isReady to MDST and isMobileDataStateTrackerReady to
ConnectivityService and call it from isMobileOk.

Bug: 10351868
Change-Id: I92f9d58121b88186b636cd71c2fd2ef9a28f7cf6
Add support for handling mobile provisioning networks.

When a sim is new or it has expired it needs to be provisioned
with the carrier. Basically provisioning is associating a sim with
a user account. When a sim isn't provisioned then operators will
restrict access to the network and only allow certain addresses
or services to be used.

This set of changes allows two types of provisioning networks to be
recognized. The first is a network that causes all DNS lookups to be
redirected to a different address than was intended. This is exemplified
by how T-Mobile works.

The second technique uses a special apn for provisioning. An example is
AT&T where lwaactivate is the provisioning apn and broadband is the
normal apn. We first try broadband and if we are unable to connect we
try lwaactivate. When we see the activate we identify it as special and
the ApnContext.isProvisioningApn will return true.

In the future our plan is to create a new network type that can be added
to the apn list, but for now it identified by name.

Here is a list of significant changes:

 - CaptivePortalTracker now only test WiFi networks instead of all networks
 - checkMobileProvisioning checks for provisioning networks and doesn't
   try to ping.
 - IConnectivityManager.aidl changes:
   * getProvisioningOrActiveNetworkInfo was added to and used by Manage
     mobile plan in WirelessSettings so even when there is no active
     network it will still allow provisioning. Otherwise it would report
     no internet connection.
   * setSignInErrorNotificationVisible is used by both
     CaptiviePortalTracker and checkMobileProvisioning so they use the
     same code for the notifications.
   * checkMobileProvisioning was simplified to have only a timeout as
     returning the result is now harder as we abort simultaneous call
     otherwise we'd could get into loops because we now check every time
     we connect to mobile.
 - Enhanced MDST to handle the provisioning network.
 - Added CONNECTED_TO_PROVISIONING_NETWORK to NetworkInfo to make a new
   state so we don't announce to the world we're connected.
 - TelephonyIntents.ACTION_DATA_CONNECTION_CONNECTED_TO_PROVISIONING_APN
   is sent by the low level data connection code to notify Connectivity
   Service that a provisioning apn has connected. This allows CS to
   handle the connection differently than a normal connection.

Bug: 10328264
Change-Id: I3925004011bb1243793c4c1b963d923dc2b00cb5
Do not change NetworkInfo.DetailedState.

I'd changed DetailedState to force ConnectivityService to treat
provisioning apn's specially. In particular so that they wouldn't
be identified they were fully connected until the provisioning
actually started. The problem is that DetailedState is a public enum
that has a CTS test and just changing the CTS to allow for the new
state (CONNECTED_TO_PROVISIONING_NETWORK) was inappropriate.

Instead I've added a new mIsConnectedToProvisioningNetwork variable
and used the DetailedState.SUSPENDED as the intermediate state.

Bug: 10620248
Change-Id: Id4a842398cad67455541ce629959351c27d83639
Merge branch 'jb43' of https://github.com/ParanoidAndroid/android_frameworks_base into jb43-legacy
Fix dock intent lookup.

PackageManagerService doesn't support UserHandle.USER_CURRENT passed in,
so always pass in the real user ID.

Change-Id: I86ed3cc41ee52628da874500d280f722501233cf
Revert "Ported: Bluetooth Message Access Profile (MAP) from CM9"

This reverts commit 0e5fdcffdd1c3f1292a7cfa04660c966f70c883a.

MAP: Support MAP Server role on Bluedroid with javax.OBEX lib.

Handle No END OF BODY for MAP 1.0 Server Get request. Only the
last packet need send the 0x49(End of Body). For intermediate
packets, we need to send 0x48 (Body).

Move definitions for MAP or FTP Service Specific UUID and
Request type for CONNECTION_ACCESS_REQUEST intent to
BluetoothExt APK.

Change-Id: I04cfeb8d53b8f8c19160a2de1eb448a7ec1f2c41
CRs-fixed: 504042
services: Fix the bug in NFC shutdown logic

nfcOff should be checked for NFC shutdown instead of radioOff,
which is used for radio status.

Change-Id: Iafd620dc89ae8bed7855e313676527d4de32cb7c
Remove duplicated methods

Change-Id: Icd92a44bc9e1b55cbb10e8325f4b92404ad4a645
Merge tag 'android-4.3_r3.1' into jb43

Android 4.3 Release 3.1
Merge branch 'jb43' of https://github.com/ParanoidAndroid/android_frameworks_base into jb43-legacy
base: App crash when select suggestion's length more than specified.

App crashed by catch IndexOutOfBoundsException which raised
by check span range when select suggested string.The root
cause is that the editor will truncate the suggested string
which length is more than it specified, but it also set span
use the suggestion's original length.

Update the suggestion's real length after editor replace the
original string to suggested.

Change-Id: I2d765701934a9e68be172cb87a104590f3cdeceb
CRs-Fixed: 532211
OBEX: Implementation of MAP and PBAP client role on Bluedroid

Implementation changes to support MAP client and PBAP client
role on Bluedroid stack.

Change-Id: Ic75e0bea10b8420aef928d868cc25acd769d5620
CRs-fixed: 530274
Bluetooth: Add error handling for callbacks in bluetooth manager

This adds null pointer check for callback before using it.

Change-Id: Ic04e5e9c766b79c9bf483f19b3b3bd7e240b4693
CRs-Fixed: 542151
be more robust with handling unknown sensors

- add support for new sensors (post 4.3)
- don't crash when encountering an unknown sensor type
- clean-up

Bug: 9683153
Change-Id: Iecd883e8a7d0297be1bd2bd4f00c5cc3ffcbccfe
Squash Dark UI commits from Slim

Frameworks: Add new configuration qualifier for UI change on the fly (1/3)

last night I got an idea after 5 weeks of breaking stuff and
doing to much complicated things. Together with mnazim we tried
today to realize this idea. So another absolut new unique SlimBean
feature is born.

The aim we wanted at the end was to give a simple and resource friendly
way to change the complete UI of a rom on the fly. So why not use
the great fallback mechanism of AOSP and change/add a new
qualifier into the AOSP core. To explain how it works.....if you want
to add a new UI just add in /res folder of any app or framework you want
folders with the qualifier "inverted". Eg. drawable-inverted-xhdpi
or values-inverted or layout-port-inverted or whatever you want. Put in
only the files you want to modify thats it.

All qualifier in AOSP are following strict rules. You can read here.
Do not forget the order of qualifier is important. The new "inverted"
qualifier we added to the UIMode qualifier. To get more information
about read here

http://developer.android.com/guide/topics/resources/providing-resources.html

So what this commit does:

- add new qualifier "inverted"
- support for API level 13 and higher
- change the custom UI on the fly
- control default UI Mode over config.xml
- working for all apps. They just need to include folders
  with the new qualifier name
- resource friendly....no resource wasting either programmticaly
  then source blow, because you just need to put in the files you
  want to change
- cause of the qualifier structure compatible with every phone,
  language or whatever qualifier you want to use on top
- 100% compatible to theme manager. If a theme misses drawables
  they are replaced with them from the current UIMode which is set.

What is the benefit why not use just a theme? We started half year
ago TRDS which was inverted gapps system base themed....means we
morphed directly the changes into the framework. This methoed was
on of the reasons why trds got so popular. Points for that are easy
first the system is themed, means each theme you activate over
theme engine works on top the themed system. So you have a base
style and can modify more if you want. The other reason is easy
a lot faster and resource friendly. Now this idea went to the
rom to provide two core system based themes and user
can do on top what they want or not without, like you have
to roms in one.

This commit just adds the support for this

cheers

mnazim and kufikugel

Change-Id: I1ef843a42d17246373eb17b4e1ec1aa9bc20d8d4

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	services/java/com/android/server/UiModeManagerService.java

Frameworks: TRDS goes Slim

add trds changed files to provide new UI mode engine

Change-Id: I67f8a26320c9971258eb0106c0574b5af9b4261c

Frameworks: TRDS new qualifier push up qualifier number (1/2)

Hey guys,

after this feature is working really well and a lot roms kanged
it we got a hint to change one thing which is indeed a good
idea to have less problems on AOSP updates and tools like
Apktool can provide us better without doing major changes every
AOSP update.

We pushed the number up to 69.....should be enough for
next years.

Please note for the one who are using our gapps at the moment
this will break actuall gapps till we published the new one
which will be end this week as usual.

After that we will begin to publish the apktool after we had
now enough tests....and who knows maybe the "official" Apktool
will provide us all now. So all in all a good time to change
the qualifier now before it is getting more and more
popular (we saw that first themes are providing us)

cheers

Lars

Change-Id: Ie1aeab38420cb825f6f7c1d0a5220a8bb55fc4c3
Frameworks: TRDS 2.0 (1/3)

After testing with huge success we discovered here
and there small problems (like NFC beam animation is broken,
TRDS was disabled on cardock etc) which mainly was caused
due that we used the already from AOSP introduced uiModes
qualifier which could cause in special conditions this
conflicts. Beside that we want a bit more flexibility.

Result: This commit introduces the inverted qualifier as
complete own qualifier undependent of the already AOSP
used ones.

Beside that it fixes all known issues......features:

- it is now completly working over the AOSP Configuration classes
  Means every app get notice of a change trough onConfiguratioChange
  and restarts it's activity if change was detected.
- app can disable that like some other configuration values
  over AndroidMainfest.xml
- beside "inverted" folder another "notinverted" folder is introduced
  for another themeing (eg white)
- qualifier order is direct before the official uiMode qualifiers
  (see AOSP docs)
- All usual Configuration actions can be used with the inverted
  qualifiers....like BroadcastChange, direct read out from every
  app etc. etc. Note: Only system can change the uiInvertedMode

So as you see a real own qualifier now

NOTE: Apktool as well aapt need to be changed to fit the "new
qualifier"....which means that we need to recompile our gapps
that they react as well on this new behaviour. Think we will get them ready
next 2 or 3 days.

Patchset:
increase support from SDK_HONEYCOMB_MR2
to FROYO to have better compatibillity
to some gapps.

Change-Id: I851740010198c400266d7ca9995eb08dbf7782bc

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/WidgetView.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
Frameworks: TRDS new 4.3 png's

Change-Id: I1aab6a5d0e1c5e5f015a48060ead36a656c50941