Display empty message if no recent location access

Bug: 120873123
Test: build, flash, and test manually
Change-Id: Ibd7a47cb814fe16ecb1c017865ab28862e17ddcc
This commit is contained in:
Lifu Tang
2019-03-15 11:40:44 -07:00
parent 15d5047209
commit ecea9e96d9
2 changed files with 6 additions and 3 deletions

View File

@@ -3785,8 +3785,12 @@
<string name="location_category_recent_location_access">Recent location access</string>
<!-- [CHAR LIMIT=30] Location settings screen, button to bring the user to view the details of recent location access -->
<string name="location_recent_location_access_view_details">View details</string>
<!-- Location settings screen, displayed when there's no recent app accessing location -->
<!-- Location settings screen, displayed when there's no recent app accessing location
(for TV) [CHAR LIMIT=100] -->
<string name="location_no_recent_apps">No apps have requested location recently</string>
<!-- Location settings screen, displayed when there's no recent app accessing location
(for phones and tablets) [CHAR LIMIT=100] -->
<string name="location_no_recent_accesses">No apps recently accessed location</string>
<!-- [CHAR LIMIT=30] Location settings screen, recent location requests high battery use-->
<string name="location_high_battery_use">High battery use</string>
<!-- [CHAR LIMIT=30] Location settings screen, recent location requests low battery use-->

View File

@@ -74,6 +74,7 @@ public class RecentLocationAccessPreferenceController extends AbstractPreference
mController = AppEntitiesHeaderController.newInstance(mContext, view)
.setHeaderTitleRes(R.string.location_category_recent_location_access)
.setHeaderDetailsRes(R.string.location_recent_location_access_view_details)
.setHeaderEmptyRes(R.string.location_no_recent_accesses)
.setHeaderDetailsClickListener((View v) -> {
final Intent intent = new Intent(Intent.ACTION_REVIEW_PERMISSION_USAGE);
intent.putExtra(Intent.EXTRA_PERMISSION_NAME,
@@ -106,8 +107,6 @@ public class RecentLocationAccessPreferenceController extends AbstractPreference
for (; i < MAXIMUM_APP_COUNT; i++) {
mController.removeAppEntity(i);
}
} else {
// If there's no item to display, add a "No recent apps" item.
}
mController.apply();
}