Gracefully handle negative indexes.

We already have logic that clamps down large values, so add similar
logic for small values, along with tests.

Bug: 156453108
Test: atest MediaProviderTests:com.android.providers.media.playlist.PlaylistTest
Change-Id: Idd827d85ecad1772b48a3ade1337a7fd41da4861
2 files changed