Automatic translation import

Change-Id: I82e4f38290b58a5cc4c84e8fd98e8e5483761bbe
BackupManagerService: Unbreak "adb restore"

The new restoreOneFile() logic aborts the loop whenever the result
isn't an actual successful restore. The problem is that a normal
backup will have plenty of non-restore cycles (APKs that are already
present being the most common), so this breaks regular "adb restore".

Go back to the original logic of completing the loop as long as the tar
file has data (or an explicit abort is generated)

Change-Id: I808cdc1c3b374e29d8438c7051e37c24a7a9d991
BackupMangerService: Pass result code in non-interactive calls

Non-interactive calls are made by Nextbit.  Continue to expose
detailed error codes for all failures.

Also:
- avoid overwriting the non-okay result codes; and
- re-enable version mismatches enforcement.

Change-Id: I54983d8f270285942db20eaff1e6de4229ec781e
ProximitySensor: check for correct MaxRange value

Use TYPICAL_PROXIMITY_THRESHOLD for devices that returns incorrect mProximitySensor.getMaximumRange() value;

Presto's proximity sensor returns values: 0.0f(near) or 5.0f(far).
mProximitySensor.getMaximumRange() must return proximity sensor's availible range, but it always return 0, so mProximityThreshold is also 0.

So boolean positive = distance >= 0.0f && distance < mProximityThreshold;  positive will never be
true.
The cause of this problem is proprietary sensor.msm8660.so, it must set proper Range and Resolution for proximity sensor.

Change-Id: I0cf81fd20f210115cbd6db10c0070b12f1c57336