Create default implementation for getSyncTarget
AttachedSurfaceControl is a public API so hidden APIs need to be implemented. Create a default implementation for a new hidden API to ensure backwards compatibility. Test: testRuntimeCompatibilityWithCurrentApi_android_net_ipsec_ike Fixes: 240300753 Change-Id: I4aec403e4bc13e2db902a291f1e42d8fe3d8fdf3
This commit is contained in:
@@ -145,5 +145,8 @@ public interface AttachedSurfaceControl {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
SurfaceSyncGroup.SyncTarget getSyncTarget();
|
||||
@Nullable
|
||||
default SurfaceSyncGroup.SyncTarget getSyncTarget() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +186,11 @@ public final class SurfaceSyncGroup {
|
||||
if (viewRoot == null) {
|
||||
return false;
|
||||
}
|
||||
return addToSync(viewRoot.getSyncTarget());
|
||||
SyncTarget syncTarget = viewRoot.getSyncTarget();
|
||||
if (syncTarget == null) {
|
||||
return false;
|
||||
}
|
||||
return addToSync(syncTarget);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user