framework: fix reference leak in activiy manager

Change-Id: If7f27ea35f5a1d1dd7c98fbe5f92729ab9ba0257
Keyguard: fix statusbar lags when default widget shown.

When statusbar became expanded KeyguardStatusView receives
onKeyguardVisibilityChanged callback and refreshes ClockView.
Because it receives more than one call and every time it reads
new values from resources it cause lags in opening statusbar panel.

Replace this code with BroadcastReceiver and ContentObserver to
refresh it only in case something was changed.

Change-Id: If0dbc1db059536806852661931cb2e6436f2acf4
Make ImageView drawable update more efficient in some cases.

When updating the view's drawable via setImageResource or setImageURI,
make sure to skip the layout pass if the old and new drawable have equal
sizes. This follows what is already done for setDrawable().

Change-Id: If73d225e38d0a2f7c616c4aeb33f67bdaed390f1
SystemUI: Fix battery indicator alignment

Before: http://i.imgur.com/WEz7pPa.png
After: http://i.imgur.com/BkvQ3Df.png

Change-Id: I7ed9f79863eeebd3dd2ba44ae95d413d4d5ebe9e

Conflicts:
	packages/SystemUI/res/layout/status_bar.xml
Fix broken XML parsing idiom.

Code that expected a single top level element in an XML file
was doing something like :

while (type != START_TAG) { next(); }

This would loop forever when the XML being parsed was empty,
where each call to XmlPullParser.next() would return END_DOCUMENT.

bug: https://code.google.com/p/android/issues/detail?id=64173
Change-Id: I7543203e976a8999ae471a6c2d629249a87011bb
Missing break in switch statement

Change-Id: I462c0c5fec96a850032266b04419ec409ad02174