Utility function to determine device type

Determine device type by screen type.
Differentiate devices into phone, hybrid and tablet.

添加定义设备类型的功能

通过获取屏幕参数来定义设备类型.
将设备分为手机, 跨界机以及平板.
[2/2] Navigation bar buttons customization

* Add option for user to customize navigation bar.
* Add device type checking using the previously added utility function.
* Fix buttons layout in mdpi & hdpi in landscape.
* Fix search_light pointing direction in landscape.
* Fix issues with RTL layouts.
* Fix orientation determination logic.
* Add alpha value applied to all layouts.
* Fix error with backAlpha values.
* Add null check all button usages.

[2/2] 个性化导航栏按键

* 添加导航栏自定义的选项.
* 添加用先前加入的功能对设备类型进行检测.
* 修复mdpi和hdpi在水平视图下的按键布局.
* 修复search_light在水平视图下的指向.
* 修复RTL布局下的一些问题.
* 修复旋转方向判定逻辑.
* 添加alpha值至全部布局.
* 修复backAlpha值错误, 采用findButton而不是findViewWithTag.
* 添加按键使用的空值检测, 用户可能隐藏他们.

Thanks to CyanogenMod for the original implementation.
感谢CyanogenMod原创实现此功能.

[1/2] in platform_frameworks_base
[2/2] User configurable double tap to sleep gesture

Add options to enable
  * glow pad double tap gesture to put device to sleep.
  * pattern double tap gesture to put device to sleep.
  * pin & password double tap gesture to put device to sleep.
  * status bar double tap gesture to put device to sleep.

[2/2] 用户可配置的双击锁屏手势

添加选项来启用
  * 双击光圈锁屏的手势
  * 双击图案盘的手势
  * 双击密码输入框锁屏的手势
  * 双击通知栏锁屏的手势

[1/2] in platform_frameworks_base

Thanks to CyanogenMod(@dalingrin and @travp624) for the original
implementation.
Thanks to @rascarlo for the user configurable concept.

感谢CyanogenMod(@dalingrin and @travp624)对此功能的原创实现.
感谢@rascarlo的用户可配置理念.

Reference commits:
参考commits:

CyanogenMod/android_frameworks_base@f258f4479bc5397ad2c4d1ffa07125a036360196 (or http://review.cyanogenmod.org/55645)
CyanogenMod/android_frameworks_base@c0fdfafc8c2d9620172dcfad81f9100e1883e1bb (or http://review.cyanogenmod.org/57257)
rascarlo/android_frameworks_base@59238e59cfecf4620eb59e93753eb2e8d16b3dbc