Base: huge cleanup

*) catch unregistering receivers to prevent crashes
*) remove unused imports
*) remove unneeded semicolons
*) manual array copy
*) string comparisons with == instead of equals()
*) unneccessary boxing and unboxing
*) codestyle
*) update gradle version
*) much much more

Change-Id: I9eb301d2096dffdda6b403e1e16fcc00e56e1e55

Conflicts:
	build.gradle
	core/build.gradle
	core/java/android/widget/ViewFlipper.java
	core/java/com/android/internal/app/PlatLogoActivity.java
	core/java/com/android/internal/util/cm/NavigationRingHelpers.java
	core/java/com/android/internal/util/slim/DeviceUtils.java
	core/java/com/android/internal/widget/LockPatternUtils.java
	packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java
	packages/Keyguard/src/com/android/keyguard/KeyguardPINView.java
	packages/Keyguard/src/com/android/keyguard/KeyguardSelectorView.java
	packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java
	packages/Keyguard/src/com/android/keyguard/KeyguardViewStateManager.java
	packages/Keyguard/src/com/android/keyguard/msim/MSimCarrierText.java
	packages/SystemUI/build.gradle
	packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
	packages/SystemUI/src/com/android/systemui/DockBatteryMeterView.java
	packages/SystemUI/src/com/android/systemui/SearchPanelView.java
	packages/SystemUI/src/com/android/systemui/quicksettings/QuietHoursTile.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/Traffic.java
	policy/build.gradle
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java