Verify isEmpty by checking if one row exists

In case of large MediaProvider database we may see ANR due to query
timing out while counting for number of rows. To avoid this, changed
isEmpty() to use LIMIT clause to query and return just one row to
confirm that table is empty instead of traversing the whole database for
count(_id).

Bug: 171369884
Test: Manual
Merged-In: Ie2ce7bbda882c5afce0aed238860a175695e735e
Change-Id: Ie2ce7bbda882c5afce0aed238860a175695e735e
(cherry picked from commit 502d5113230e3add45b5e4370526ab2934b1b59a)
1 file changed