mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-26 01:43:59 +02:00
Limit what data the provider exposes
Also rename id to _ID as that is what the documentation recommends (required to use a Cursor with a ListView).
This commit is contained in:
@@ -67,6 +67,6 @@ public interface ScaleMeasurementDAO {
|
||||
void deleteAll(int userId);
|
||||
|
||||
// selectAll() is equivalent to getAll(), but returns a Cursor, for exposing via a ContentProvider.
|
||||
@Query("SELECT * FROM scaleMeasurements WHERE userId = :userId AND enabled = 1 ORDER BY datetime DESC")
|
||||
@Query("SELECT id as _ID, datetime, weight, fat, water, muscle FROM scaleMeasurements WHERE userId = :userId AND enabled = 1 ORDER BY datetime DESC")
|
||||
Cursor selectAll(int userId);
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@ public interface ScaleUserDAO {
|
||||
|
||||
// selectAll() and select() are equivalent to getall() and get(), but return a Cursor,
|
||||
// for exposing via a ContentProvider.
|
||||
@Query("SELECT * FROM scaleUsers")
|
||||
@Query("SELECT id as _ID, username, birthday, bodyHeight, gender, activityLevel FROM scaleUsers")
|
||||
Cursor selectAll();
|
||||
|
||||
@Query("SELECT * FROM scaleUsers WHERE id = :id")
|
||||
|
Reference in New Issue
Block a user