Squash Commits of Advanced PowerMenu + Common Interface/Classes (WIP) [1/2]

Ported from SlimRom

1.PowerMenu Support
2.Update some navgation bar icon to fit kitkat, also add some icons we will used later
3.Add some basic/common core additional interface/class we will used later
4.Add SystemUI toggle we will use later

----------------------------------------

Power Menu Support Below

- airplanemode
- custom apps
- screenshot
- reboot
- sound
- power off

are available as options to add or remove or customize with our
easy dslv settings

As well we are only using our central classes for it....means adding
whatever shortcut is mostly only a 10 line change in future

PatechSet:
fb: support new dslv

see Settings

Fix possible NPE when we don't have Settings part

Change-Id: I6dea6544819196694a19ec022d1b1cc87245de1e

============================

PatchSet:

Add SystemUI toggle

add SystemUI toggles for power menu and other toggles we may use later
toggles are:
- toggleNotificationShade();
- toggleQSShade();
- toggleScreenshot();
- toggleLastApp();
- toggleKillApp();

Change-Id: Icb9e7d773b4c3e266d743f5489a606202715d88d

Change-Id: I6dea6544819196694a19ec022d1b1cc87245de1e

=====================================

PatchSet:
move to core

Change-Id: I99b8fe25843ba36ce56ae9774697d53018a2445b

PatchSet:

update

Change-Id: I2093221d3a95b43d5f278f9c83d26e684e8389b2

Change-Id: I6dea6544819196694a19ec022d1b1cc87245de1e
Screenshot Delete thanks to DvTonder and

PA where I saw this patch. Changes to original:

minor cleanup + added all needed drawables (xxhpdi and mpdi)

Change-Id: Id458312cd6a66d12caa6ceffba3ba13547caa939
QwertyKeyListener: Add support for www and .com key

Add support for www and .com key on devices with physical keyboards.
This code is identical to what was present in ICS.

Change-Id: I55e6c248959e0a0657bbd8e3840470ae7adbd8ed
Revert "base: App crash when select suggestion's length more than specified."

This reverts commit dcf75fbfd06c6a940e4124550edd19e191656047.

Change-Id: I6d236f16e9c428b06caf4423903839d54cf24bd0
frameworks/base: Fix to avoid crash when the tab is not set from app

As the current tab is not set from application, getChildTabViewAt
returns Null value. Added a condition which checks whether mSelectTab
is set to first Tab.

(cherry picked from commit 9be6755efb149b22c36aa3eb7cc4ffe7e765e08a)

Change-Id: I11c77ca96333e2663d28db1b5fdb46602bd9e745
CRs-Fixed: 321176
Framework: Fix button label toasts when layout is RTL

Google have decided to set their gravity "relatively", while they measure only from the left.
The result? Toasts appearing in the wrong side of the screen.

Change-Id: If5e9d5fc2751fbef3eb058b241168fb9d8bf4b98
ActionBar: Compute required items prior to optional items

When computing if a item should be shown in the action bar, required items need to be compute prior
to optional ones. Otherwise, in some cases (when the optional menu goes to the left of required
items then the algorithm could determine that optional has space to be shown and force the show of
required items, causing the required items to not be shown).
A concrete case is in the Email app. In the message_view_fragment_option.xml are defined 5 menus,
that when are all shown (xe: in Exchange mailbox account type) the bar is complete filled. But if
the overflow button is forced to be shown (the device has no permanent menu key) the overflow button
overlaps the older button, because space of 'ifRoom' items are wrong computed.

Change-Id: I6fc8e3e202d76f9704d7ec2383c7ee6f7b05ba76
Fix layout of MultiWaveView and GlowPadView.

If the calculated size of the rings is much smaller than the measured
size (which is happening e.g. on mdpi 600x1024 tablets), the glow pad
appeared shifted to the right.
This happened due to the insets being calculated as difference of
available and needed size, and later on being added to the available
size. Example numbers (Nexus 4 with density forced to 160):
- computed size in onMeasure: 768x505
- scaled size in onMeasure: 505x505
- thus, insets are calculated as 131/0
- in onLayout, placementWidth (364) and max target width (108) are much
  smaller than width (768)
- thus, center is calculated as 131 + (768 / 2) = 515, thus shifted to
  the right

Fix that by not using width in the calculation, as the inset size
already takes it into consideration.

JIRA:CYAN-829
Change-Id: Ifc2a93214f812f554a8fed3243eed66aec9f00c9
android_os_FileUtils_getVolumeUUID: Fix the incorrect logical for call blkid_get_tag_value.
    There are two problems in here.
  1. For the function blkid_get_tag_value third parameter is should be the device, not the mount pointer, in the MediaPrivader.attachVolume, it will pass the mount path to call this function.
  2. The UUID for device is hex, so call atoi is not right. I think call strtol is better than atoi.

Change-Id: I76598a0993f08add3e9c7541cbc082d8d85e9af4