orkut: fix "orkut has stopped" error message when upload a image

An exception java.lang.NullpointerException is thrown because "intent" is
null pointer. here we avold using null intent pointer, the image can be uploaded
into orkut.

Change-Id: I840527f1e00f8c519e086b2a85f6b7054d5a51bf
Author: Dongxing Zhang <dongxing.zhang@intel.com>
Signed-off-by: Dongxing Zhang <dongxing.zhang@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: 39297

Conflicts:
	core/java/android/app/PendingIntent.java
add RTSP scheme

When user types rtsp scheme at the address tool bar, the url is changed
to http scheme. To prevent this, RTSP scheme handling code is added.

Change-Id: I97edc4f4249f8bab9a8657b529473814f8938cc1
ContentProvider: Avoid duplicate initialization of AsyncTask

AsyncTask is being initialized by ActivityThread to ensure its static
handler initilization and ContentProvider need not duplicate the logic.

Change-Id: I48bc88bdba32b56114f09c04a75480e26508f704

Conflicts:
	core/java/android/content/ContentProvider.java
YuvToEncoder patch

The MCU height is max_v_samp_factor = 2 DCT rows so you must pass at least 16
scanlines on each call to jpeg_write_raw_data(), which is to say 16 actual
sample rows of Y and 8 each of Cb and Cr.

The original implement of Yuv420SpToJpegEncoder::compress didn't add padding to the frame buffer
when height and width aren't aligned with 16 pixel. It will cause illegal memory violation and core dump.

Change-Id: I3b98b75284fd8ff8e000a30f0f4034be01304ff7
Author: Zhao Liang <leo.zhao@intel.com>
Signed-off-by: Zhao Liang <leo.zhao@intel.com>
Signed-off-by: Tong, Bo <box.tong@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: 47824 19092 19696 18528

Conflicts:
	core/jni/android/graphics/YuvToJpegEncoder.cpp
hide "paste" window when ActionBar is already active

Hide "paste" popup window when ActionBar already has a "paste" menu button.
- The "paste" popup window and "paste" ActionBar menu are duplicated.
- Due to "paste" popup window, hard to press the ActionBar menu.

steps to reproduce:
1. launch Browser and go to "google.com" in landscape mode.
2. long press on URL address (make "Select All") and select "Copy"
3. long press on URL address (make "Select All"), again
4. you can see the "paste" window, although actionbar already has a "paste"
   menu button.

Bug: 8080106
Change-Id: I9abe91cb2d39ea10dd28f72932700b810311b443
Wrong argument: isValidLockdownProfile

isValidLockdownProfile ignores return value of split in for loop.

Change-Id: Id998cb85ba9db84931fc0ed17f591a35b7168e62
change the policy when connecting to Wi-Fi access point. The secure
AP has higher priority than the open AP.
Change-Id: I4180419bd30619aa7079b8cee0f650d65a813b69
Audio: Fix abnormal keytone playback during silent mode changing

Change-Id: Icfc4003c9756b3c33578c137e59dc4a2b4f25647
Author: Chenyang Du <chenyang.du@intel.com>
Signed-off-by: Ertao Zhao <ertaox.zhao@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: 19084 4898
Fix CalendarView CTS failures

Why: Google added a condition to save cpu time(Maybe). It would cause
the CalendarView not showing the title in Jan. because the default
value of mCurrentMonthDisplayed is 0.

How: Assign -1 as default value to mCurrentMonthDisplayed. The
constructor will call goTo() to assign a correct value to it. Not only
that, previously it only shows "month" in the title but now it also
shows year. So I also added a newYearDisplayed for showing it correctly.

Verify steps: CTS should not fail in the Holo test in Jan. I have
verified it with android-cts-4.0.3_r1.

Change-Id: I44f938ff416b4943ea36abcd0ceadcbf03ae7377

Conflicts:
	core/java/android/widget/CalendarView.java
[ScreentShot]: change the implementation of get image file size

Because File can't get permission to get file size of screenshot image.
So use InputStream to get file size correctly of screenshot image.

Change-Id: I1c3df40ddd526d3431bc899642d00f4021d7eeb3
Author: Bo Huang <bo.b.huang@intel.com>
Signed-off-by: Bo Huang <bo.b.huang@intel.com>
Signed-off-by: shi yang <yang.a.shi@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: 30940

Conflicts:
	packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
change log location in publishContentProvider for avoid crash

If developer enable a log of DEBUG_MU for debugging,
application could occur activity manager crash.
function named publishContentProvider could occur NullPointException
when using 'r' instance or using 'dst' instance.
that log doesn't consider whether variable is null or not.
therefore log code have to move to into if statement block.

Change-Id: I71e5528514e0be3bd7b61761a322a176fde6f78e
add empty stub for build compatibility

Add an empty stub for CopyJavaInputStream for build-time compatibility.

Change-Id: Ib1d32c6bedcbeeb192a31c9145824312a5bd724f
Add system partition check for vpn dialogs

The VPN permission check required internal knowledge that
other checks in the system would ensure that
package "com.android.vpndialogs" was genuine. In the
off chance those other checks change, or someone is
able to spoof the package name, this will at least
check to see that the app is on the system image; one
more hurdle to jump.

Signed-off-by: William Roberts <wroberts@tresys.com>

Change-Id: I4875a4a30bea8975943c889d3b1ebefc84c07ee9
NPE in SearchManager.triggerSearch

mAssociatedPackage field is never initialized and cause NPE.

Change-Id: Ibf0d44b2170b7cbfe4a883008254a086e03579c5
Consider LayoutDirection when adding horizontalSpacing

Fixes an issue where LayoutDirection wasn't considered when moving the
nextLeft postion.

Change-Id: I0bb08623cc4d3e4091567f5d8f25995651222b51
if the source is hls or rtsp,do not skip prepare when enter the full screen mode

Now, HLS and rtsp use nuplayer to play.Since nuplayer has not such function like reset display during playing,
when enter the full screen mode from inline mode in HTML5, the preparation should not be skipped.
If a new display needs to be setted, the old player must be resetted
Signed-off-by: ywan171 <yi.a.wang@intel.com>

Change-Id: I23de1cec9bff7d5f93839ccb118cc4d6477f02fe
Author: Yi Wang <yi.a.wang@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: 52762
Return value of substring ignored in removeTrailingPeriod.

Change-Id: I7f7347db862995bef675c84ca652e54db96941e4
Fix appwidgets not updating

Previously there was a bug where if an appwidget's update caused a
TransactionTooLargeException then the AppWidgetServiceImpl.Host's
callbacks were completely disabled, for all widgets.

The fix still allows a DeadObjectException or other RemoteException
to disable the host callbacks, as that would be caused by a bad host.

Fixes issue 28216 on the public tracker
https://code.google.com/p/android/issues/detail?id=28216

Change-Id: I5c5d5939d7211ed23cca69e6674de730b51b0f3e
Signed-off-by: Kevin Barry <kevin@teslacoilsw.com>
SystemUI: Add missing recycle calls
aidl: factor out Java output

Change-Id: Id206eeaf733ddfdc2bd4e52241f3bbf896715e73