Remove hidden API usage in WM Extensions impl

Reference implementation of WM Extensions included a hidden API
call, which is prohibited when coming from non-system apps.

Bug: 179968070
Test: Build, test on YT and sample apps
Change-Id: Ic8b215b811a5e5d6abaacdb8ff0bf82fc3995d99
This commit is contained in:
Andrii Kulian
2021-02-12 15:08:12 -08:00
parent 7d0e92c509
commit d1f0f42cba
2 changed files with 2 additions and 2 deletions

View File

@@ -72,7 +72,7 @@ class SampleExtensionImpl extends StubExtension implements
private List<ExtensionDisplayFeature> getDisplayFeatures(@NonNull Activity activity) {
List<ExtensionDisplayFeature> features = new ArrayList<>();
int displayId = activity.getDisplayId();
int displayId = activity.getDisplay().getDisplayId();
if (displayId != DEFAULT_DISPLAY) {
Log.w(TAG, "This sample doesn't support display features on secondary displays");
return features;

View File

@@ -84,7 +84,7 @@ class SampleSidecarImpl extends StubSidecar implements
private List<SidecarDisplayFeature> getDisplayFeatures(@NonNull Activity activity) {
List<SidecarDisplayFeature> features = new ArrayList<SidecarDisplayFeature>();
int displayId = activity.getDisplayId();
int displayId = activity.getDisplay().getDisplayId();
if (displayId != DEFAULT_DISPLAY) {
Log.w(TAG, "This sample doesn't support display features on secondary displays");
return features;