Make 4.3 work

Squashed set of commits kanged from jf

Change-Id: I2d7488e7ff060f8929f3a5ec8031472a43bafd91
Merge branch 'cm-10.2' of github.com:CyanogenMod/android_device_samsung_d2-common into HEAD