[MTP] fix an ArrayIndexOutOfBoundsException

The object's file path may include more than 255 characters that is
out of MTP string limitation and this will casue a exception
"ArrayIndexOutOfBoundsException". This patch add checking for the
string length of path.

Change-Id: I74ca12e2bccd5f4644aadc79904fa0f3a3415a2a
Author: Changbin Du <changbinx.du@intel.com>
Signed-off-by: Changbin Du <changbinx.du@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 56769
Javacrash java.lang.NullPointerException in com.android.browser.

Provide a WebView interface in WebSettings, for BrowserSettings need to access it.

Change-Id: I8a4b9c9a746c9c0b2a1a6adec35943de9fb2f9b0
Author: Yijun Zhu <yijunx.zhu@intel.com>
Signed-off-by: Yijun Zhu <yijunx.zhu@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 34962
Fix for breakText returning count of glyphs not chars.

Paint.breakText should return the number of characters measured to a given maxWidth, but it returns the number of glyphs instead. The solution loops through the advances and whenever if finds an advance with length bigger than 0 decrements it until reaching zero or the end of the advances. The advance has a zero when a glyphs is for more than on character, for the subsequent characters. The width of the glyphs is added at the first character.

Change-Id: If26fca3a08133d08572dfda1e33536cc0bd8b1e5