Stay organized with collections
Save and categorize content based on your preferences.
CarPropertyManager.SetPropertyCallback
public
static
interface
CarPropertyManager.SetPropertyCallback
android.car.hardware.property.CarPropertyManager.SetPropertyCallback
|
A callback CarPropertyManager#setPropertiesAsync
when succeeded or failed.
Summary
Public methods
onSuccess
public abstract void onSuccess (CarPropertyManager.SetPropertyResult setPropertyResult)
Method called when the SetPropertyRequest
successfully set the value.
This means: the set value request is successfully sent to vehicle
and
either the current property value is already the target value, or we have received a
property update event indicating the value is updated to the target value.
If multiple clients set a property for the same area ID simultaneously with different
values, the order is undefined. One possible case is that both requests are sent to the
vehicle bus, which causes two property update events. As a result, the success callback
would be called for both clients, but in an undefined order. This means that even if
the success callback is called, it doesn't necessarily mean getting the property would
return the same value you just set. Another client might have changed the value after you
set it.
If only one requests is successfully processed by the vehicle bus, overwriting the
other request, then only one success callback would be called for one client. The other
client would get the failure callback with
CarPropertyManager#STATUS_ERROR_TIMEOUT
error code.
If multiple clients set a property for the same area ID simultaneously with the same
value. The success callback for both clients would be called in an undefined order.
Parameters |
setPropertyResult |
CarPropertyManager.SetPropertyResult |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-17 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-17 UTC."],[],[],null,["# CarPropertyManager.SetPropertyCallback\n======================================\n\n\n`\npublic\nstatic\n\n\ninterface\nCarPropertyManager.SetPropertyCallback\n`\n\n\n`\n\n\n`\n\n|----------------------------------------------------------------------|\n| android.car.hardware.property.CarPropertyManager.SetPropertyCallback |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA callback [CarPropertyManager#setPropertiesAsync](/reference/android/car/hardware/property/CarPropertyManager#setPropertiesAsync(java.util.List\u003candroid.car.hardware.property.CarPropertyManager.SetPropertyRequest\u003c?\u003e\u003e,%20android.os.CancellationSignal,%20java.util.concurrent.Executor,%20android.car.hardware.property.CarPropertyManager.SetPropertyCallback)) when succeeded or failed.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onFailure](/reference/android/car/hardware/property/CarPropertyManager.SetPropertyCallback#onFailure(android.car.hardware.property.CarPropertyManager.PropertyAsyncError))`(`[CarPropertyManager.PropertyAsyncError](/reference/android/car/hardware/property/CarPropertyManager.PropertyAsyncError)` propertyAsyncError) ` Method called when [SetPropertyRequest](/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest) returns an error. |\n| ` abstract void` | ` `[onSuccess](/reference/android/car/hardware/property/CarPropertyManager.SetPropertyCallback#onSuccess(android.car.hardware.property.CarPropertyManager.SetPropertyResult))`(`[CarPropertyManager.SetPropertyResult](/reference/android/car/hardware/property/CarPropertyManager.SetPropertyResult)` setPropertyResult) ` Method called when the [SetPropertyRequest](/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest) successfully set the value. |\n\nPublic methods\n--------------\n\n### onFailure\n\n```\npublic abstract void onFailure (CarPropertyManager.PropertyAsyncError propertyAsyncError)\n```\n\nMethod called when [SetPropertyRequest](/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest) returns an error.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------------------|------------------------------------------------|\n| `propertyAsyncError` | `CarPropertyManager.PropertyAsyncError` \u003cbr /\u003e |\n\n### onSuccess\n\n```\npublic abstract void onSuccess (CarPropertyManager.SetPropertyResult setPropertyResult)\n```\n\nMethod called when the [SetPropertyRequest](/reference/android/car/hardware/property/CarPropertyManager.SetPropertyRequest) successfully set the value.\n\nThis means: the set value request is successfully sent to vehicle\n\nand\n\neither the current property value is already the target value, or we have received a\nproperty update event indicating the value is updated to the target value.\n\nIf multiple clients set a property for the same area ID simultaneously with different\nvalues, the order is undefined. One possible case is that both requests are sent to the\nvehicle bus, which causes two property update events. As a result, the success callback\nwould be called for both clients, but in an undefined order. This means that even if\nthe success callback is called, it doesn't necessarily mean getting the property would\nreturn the same value you just set. Another client might have changed the value after you\nset it.\n\nIf only one requests is successfully processed by the vehicle bus, overwriting the\nother request, then only one success callback would be called for one client. The other\nclient would get the failure callback with\n[CarPropertyManager#STATUS_ERROR_TIMEOUT](/reference/android/car/hardware/property/CarPropertyManager#STATUS_ERROR_TIMEOUT) error code.\n\nIf multiple clients set a property for the same area ID simultaneously with the same\nvalue. The success callback for both clients would be called in an undefined order.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------------------|-----------------------------------------------|\n| `setPropertyResult` | `CarPropertyManager.SetPropertyResult` \u003cbr /\u003e |"]]