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
Avoid layout passes when updating data activity indicators.

ImageView can optimize out layout passes if old and new drawable have
equal sizes. Take advantage of that by displaying a transparent drawable
with the same size as the in/out drawables when there's no activity
instead of clearing out the drawable in that case.

Change-Id: Iaaa556ffab3ed4be1da8016ed40d0a9c2efcde01
keyguard: fix layout for sw320dp devices

800x480px dpi devices have less screen space than the xhdpi devices
Google designed the layout for and the layout needs adjustment.

- Reduce the lockscreen security container size such that the clock
  widget has enough space to display its content.
- In the SIM PIN/PUK view, Google put an empty widget on top, but
  we don't have space for that, increase its size such that the
  widget practically disappears.

This should not have any effect on devices with larger screens.

Ported from cm-10.2.
* Removed invalid mdpi layout leftover from framework-res
* Fix keyguard for mdpi devices too

Change-Id: I9e811cfd312abae24a9cad189d19e73848f6c4c1
Merge "Make ImageView drawable update more efficient in some cases." into cm-11.0
Merge "Avoid layout passes when updating data activity indicators." into cm-11.0
Merge "keyguard: fix layout for sw320dp devices" into cm-11.0
Add support for allow-permission extension.
This will grant a sharedUserId arbitrary permissions as defined by XML files
in /system/etc/permissions.

Change-Id: I4c0be56173b89621c4cc7ae589715a030931e8d5
Improve scrolling cache

Scrolling cache helps make short scrolls/flings smooth but will
cause stutter when long flings are made. This patch disables
scrolling cache when long flings are made.

This patch also fixes a related bug where scrolling cache will
not be enabled properly when transitioning from flinging to scrolling.

Patch Set 2: Calculate threshold based on maximum velocity (Sang Tae Park)

Credits: Pawit Pornkitprasan

Change-Id: I1fdbaad92263c9f983a32900e74eba1f0367902b
Signed-off-by: Arham Jamal <arhamjamal@gmail.com>
Merge commit '33110a0' into cm-11.0