Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 2 additions & 25 deletions rpc/srv/dsFPD.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@
#define IARM_BUS_Lock(lock) pthread_mutex_lock(&fpLock)
#define IARM_BUS_Unlock(lock) pthread_mutex_unlock(&fpLock)

/* Below block allows the default brightness of a device (after a reset) to be set from
* device-specific recipes. If recipes say nothing, it should use max brightness supported. */
#ifndef dsFPD_BRIGHTNESS_DEFAULT
#define dsFPD_BRIGHTNESS_DEFAULT dsFPD_BRIGHTNESS_MAX
#endif

static int m_isInitialized = 0;
static int m_isPlatInitialized=0;
static pthread_mutex_t fpLock = PTHREAD_MUTEX_INITIALIZER;
Expand Down Expand Up @@ -182,28 +176,11 @@ IARM_Result_t dsFPDMgr_init()
string value;
int maxBrightness = dsFPD_BRIGHTNESS_DEFAULT;

value = device::HostPersistence::getInstance().getProperty("Power.brightness", numberToString(maxBrightness));
_dsPowerBrightness = stringToNumber(value);

_dsPowerBrightness = device::HostPersistence::getInstance().getDefaultProperty("Power.brightness");

Comment on lines 176 to +180
value = device::HostPersistence::getInstance().getProperty("Text.brightness", numberToString(maxBrightness));
_dsTextBrightness = stringToNumber(std::move(value));

#if(dsFPD_BRIGHTNESS_DEFAULT != dsFPD_BRIGHTNESS_MAX)
/* If we're applying a default brightness that's not MAX, check for currently persisted values. If any of them = MAX,
* update those to the current default. If the persisted values != MAX, leave them alone because they're likely to have been
* set by the user. */
if(dsFPD_BRIGHTNESS_MAX == _dsPowerBrightness)
{
INT_INFO("Applying new default brightness to power indicator. Changing from %d to %d.\n", _dsPowerBrightness, dsFPD_BRIGHTNESS_DEFAULT);
_dsPowerBrightness = dsFPD_BRIGHTNESS_DEFAULT;
}
if(dsFPD_BRIGHTNESS_MAX == _dsTextBrightness)
{
INT_INFO("Applying new default brightness to text indicator. Changing from %d to %d.\n", _dsTextBrightness, dsFPD_BRIGHTNESS_DEFAULT);
_dsTextBrightness = dsFPD_BRIGHTNESS_DEFAULT;
}
#endif

INT_INFO("Power Brightness Read from Persistent is %d \r\n",_dsPowerBrightness);
INT_INFO("Text Brightness Read from Persistent is %d \r\n",_dsTextBrightness);

Expand Down
Loading