watermark: Place watermark in the bottom-right when both deltax and deltaty are 0

The default behavior is to replicate the watermark all over the screen but this can
be too intrusive. The repetition is controlled by deltax and deltay and if they are
both 0 the watermark will actually be drawn off-screen and thus not shown.

We take advantage of this to add a special behavior when they are both 0 that simply
places them in the bottom right. This patch doesn't take UI elements into account and
may actually overlay soft-buttons and other chrome.

Change-Id: I4cff1326b8aaecdbc471eaf48e95bc2865181366
Automatic translation import

Change-Id: I2a439bab987da340f408e931ae14ead7e4d7dd0e

Conflicts:

	core/res/res/values-ca/cm_strings.xml
	core/res/res/values-cs/cm_strings.xml
	core/res/res/values-da/cm_strings.xml
	core/res/res/values-el/cm_strings.xml
	core/res/res/values-es/cm_strings.xml
	core/res/res/values-fi/cm_strings.xml
	core/res/res/values-it/cm_strings.xml
	core/res/res/values-ja/cm_strings.xml
	core/res/res/values-ko/cm_strings.xml
	core/res/res/values-lb/strings.xml
	core/res/res/values-lt/cm_strings.xml
	core/res/res/values-pt-rBR/cm_strings.xml
	core/res/res/values-pt-rPT/cm_strings.xml
	core/res/res/values-ru/cm_strings.xml
	core/res/res/values-sk/cm_strings.xml
	core/res/res/values-sr/cm_strings.xml
	core/res/res/values-tr/cm_strings.xml
	core/res/res/values-zh-rCN/cm_strings.xml
	packages/PrintSpooler/res/values-ku/strings.xml
Add a null check

In theory night prevent the NPE on v500 when trying enable/disbale autorotate
http://pastebin.com/LAPVgsp8

Change-Id: I550cb570042855e4b9bc85bb1e8ef2ada702a7dc
Navbar: reduce some unnecessary object creation

-reduce unnecessary object (AnimationSet) creation in onTouch -> setPressed
-reduce some extra chromosomes from AwesomeAction

Change-Id: I432ebdae79206219d67ac52d953b002e37582ab8
Navbar: Determine expanded shade state locally for ACTION_NOTIFICATIONS

Force incomplete penetrance for the lazy programmers allele in the expand
notifications/quicksettings action target by sending a single statusbarservice
AIDL binder call from AwesomeActions and THEN determining the correct action
locally in PSB based on the current shade state

Change-Id: I24c6afcf2e6199c5afb31b5a7babb7f83fb4731f
Merge "watermark: Place watermark in the bottom-right when both deltax and deltaty are 0" into kk44
Statusbar: clean up expanded status bar header layout

For future reference: view.invisibile keeps the spacing for layout purposes and
was pushing the "flip to" buttons off the screen with long dates and am/pm enabled.
Also, make the padding between header items consistent and resize button spacing
slightly in case 3 are enabled which also pushes the last button off the screen.

Change-Id: I88cc1302bfe8f32bb7396680704118865c872163
Navbar: alternate layouts

allow up to 5 customizable alternate layouts and add special arrow keys
on each side to switch layouts.

Change-Id: I2bfddb5967a77c63e1d403d1defa01bb3d123d42
Revert "ContentProvider: Avoid duplicate initialization of AsyncTask"

This change leads to soft reboots.
To reproduce:
  *) Take a screenshot
  *) Share it a few times
  *) The chooser dialog should appear but instead the system dies

E/AndroidRuntime( 4993): *** FATAL EXCEPTION IN SYSTEM PROCESS: PowerManagerService
E/AndroidRuntime( 4993): android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
E/AndroidRuntime( 4993): 	at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6027)
E/AndroidRuntime( 4993): 	at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:820)
E/AndroidRuntime( 4993): 	at android.view.View.requestLayout(View.java:16455)
E/AndroidRuntime( 4993): 	at android.view.View.requestLayout(View.java:16455)
E/AndroidRuntime( 4993): 	at android.view.View.requestLayout(View.java:16455)
E/AndroidRuntime( 4993): 	at android.view.View.requestLayout(View.java:16455)
E/AndroidRuntime( 4993): 	at android.view.View.requestLayout(View.java:16455)
E/AndroidRuntime( 4993): 	at android.view.View.requestLayout(View.java:16455)
E/AndroidRuntime( 4993): 	at android.view.View.requestLayout(View.java:16455)
E/AndroidRuntime( 4993): 	at android.view.View.requestLayout(View.java:16455)
E/AndroidRuntime( 4993): 	at android.view.View.requestLayout(View.java:16455)
E/AndroidRuntime( 4993): 	at android.widget.AbsListView.requestLayout(AbsListView.java:1972)
E/AndroidRuntime( 4993): 	at android.widget.AdapterView$AdapterDataSetObserver.onChanged(AdapterView.java:814)
E/AndroidRuntime( 4993): 	at android.widget.AbsListView$AdapterDataSetObserver.onChanged(AbsListView.java:6482)
E/AndroidRuntime( 4993): 	at android.database.DataSetObservable.notifyChanged(DataSetObservable.java:37)
E/AndroidRuntime( 4993): 	at android.widget.BaseAdapter.notifyDataSetChanged(BaseAdapter.java:50)
E/AndroidRuntime( 4993): 	at com.android.internal.app.ResolverActivity$LoadIconTask.onPostExecute(ResolverActivity.java:756)
E/AndroidRuntime( 4993): 	at com.android.internal.app.ResolverActivity$LoadIconTask.onPostExecute(ResolverActivity.java:744)
E/AndroidRuntime( 4993): 	at android.os.AsyncTask.finish(AsyncTask.java:632)
E/AndroidRuntime( 4993): 	at android.os.AsyncTask.access$600(AsyncTask.java:177)
E/AndroidRuntime( 4993): 	at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
E/AndroidRuntime( 4993): 	at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 4993): 	at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 4993): 	at android.os.HandlerThread.run(HandlerThread.java:61)

This reverts commit d22a5b851abf2a06097db51368edfda7616fc34c.

Change-Id: Ibe9c1192ec73eb46e3359da991201f6088e3a78e
Merge "Revert "ContentProvider: Avoid duplicate initialization of AsyncTask"" into kk44
Navbar: add extensibility of KBV for alternative button views

Add constructors for nested KeyButtonInfo class to allow
extending in special-case keybuttonview classes

Change-Id: Ide7e850f2fc2cade6105e049df024112e9e3b4a9
Navbar: touch up alternate layout resources

add drawables for lower resolutions
add image rotation handling dependent on tablet or phone UI
add overlayable resource for layout changer size

Change-Id: Ie06ebcd6a66496a151c18f3b72ca0e5d5d9932af
hwui: Fix a sporadic crash seen during CTS runs

 * It's possible (due to race conditions) that a patch might be
   scheduled for removal twice. Just print a warning and continue
   instead of asserting and crashing.

Change-Id: I42865f6717816a743cc49ba15b839e6c3b57ed83
Fix attribute resolution in theme lookup

[Fixes Known Issues]
1. (CM) Chrome beta crashing w/ Hexo applied and menu button is pressed.
2. (AOSP) TextAppearance - fontFamily attr is incorrect (looked up in wrong package!) when
    a string value is defined in a style, and that style is set as the app's theme.

[Terminology]
1) Theme:    is the standard android definition of a theme.
             e.g in your manifest you may set android:theme="@style/foo"
2) CM-Theme: will be a Cyanogen theme. e.g. "Hexo"

3) Block: Also called index. Can be considered the cookie or ID to lookup a package in the resources.
          When a CM-Theme is applied, block 0 is framework, block 1 is the app, and block 2 is the
          CM-Theme.

[Background]
When a value for an attribute has not been found, the last resort is to look at a theme's base value.
This is done by using theme->getAttribute(...) which will return the value. The value is
unresolved if its a reference type. The block value will also be returned.

Since the value may be a reference and therefore unresolved, a call is then made to
ResTable::resolveReference(..) to do the final resolution. As part of its input, resolveReference
takes a block as a starting point.

In the case where resolveReference(...) is asked to resolve something that is not a reference,
for example, a string type, then it will simply return the same value and block. *Important* The block
value is then saved for the next call to get an attribute value. So if this block value is wrong
it will remain incorrect.

Therefore if resolveReference is passed the wrong starting block with a string value, then the wrong
block will be returned.

[Example]
1. 0x0101009b (android:attr/textColorLink) is first attribute to be looked up.
2. textColorLink has a value of 0x01020123 which maps to theme id 0x01020111. The block for theme
is "2" so block is set to 2. The value for this attribute is put into the array.
3. 0x010103ac (android:attr/fontFamily) is the next attribute to be looked up.
4. fontFamily is found in the theme as type string. The value is 0x7b9 (1977) and newblock variable
   is set to 1 since this value is found in the app's string pool. The block variable still == 2.
5. resolveReference() is called with block=2. The function does nothing and returns block=2.
   The fontFamily thus is stored wtih value=1977 and a block value of "2" instead of "0".

Change-Id: I2b979911b1b8ffb79c4cf310ae60682c84c11fcb
Reduce redundancy w/ KBV in LCBV and fix opacity wonk

Change-Id: I77ff2355940134079fbbabd9f9a73e1ea44a7481
NavbarLayout(s) - arrayification -- and fix initialization of ime buttons

Change-Id: I0ad8c478f8d99806a982437de5f4dd948cc99223
add missing patchset from layout changer menu key handling

Change-Id: I48b95fff3ee52a92646d37c5354c689f6e0c2605
Navbar: reuse the *view/info classes during layout population

We don't need to get a new ones for each button in the layout because
we're passing the constructed views to another method that actually adds them
to the viewgroup

Change-Id: I3043acf1e663c599cf6df7c9ec902f095c9e7cf0
Merge "Reduce redundancy w/ KBV in LCBV and fix opacity wonk" into kk44
Merge "NavbarLayout(s) - arrayification -- and fix initialization of ime buttons" into kk44