Fix 'input rotationevent' sometimes not working issue

Observers exist for both Settings.System.USER_ROTATION and
Settings.System.ACCELEROMETER_ROTATION config values, and
updateSettings() may get wrong rotation status if these two values are
set separately. Use "mLock" to protect this situation and make sure they
are set together.

Change-Id: Ic89e6f14b45ee839c518e135096ae18d27f0a809
Signed-off-by: Carton He <carton.he@marvell.com>
Fix leaking starting window issue

Currently monkey test can result in many "starting window" surface
layers leaked which occupies ION buffer and can cause other ION
allocation failures before reclaimSomeSurfaceMemoryLocked kicked in.

Force to remove those "starting window"s when they have not been on
screen for long time.

Bug: http://code.google.com/p/android/issues/detail?id=59885
Change-Id: Ib2f624632b598f26388395f47516f697b343e2cb
Signed-off-by: Carton He <carton.he@marvell.com>

Conflicts:
	services/java/com/android/server/wm/WindowManagerService.java
Remove unused local variable (pkg) in ResTable::getEntry method.

Change-Id: Ibb40cdd3dc3d4611078e2d3e94695a65aae7c412