Commit cc76d578 authored by Malay Keshav's avatar Malay Keshav Committed by Commit Bot

Add support to clear stored touch calibration pref data

This patch adds support to clear stored touch calibration and
association data from display prefs. To achieve this, any and all touch
data is cleared from the stored pref before adding new pref values. The
system already does this indirectly when it instantiates a new
dictionary pref value for the touch data to be stored. However if the
touch data map that the system is about to store is empty to begin with,
this instantiation of a new dictionary never happens and the change to
delete any stale stored touch data fails to propogate.

Bug: 925551
Change-Id: I7230e05d0106e87b9223b2b75d2883f2269cf8c5
Component: Display prefs, touch calibration
Reviewed-on: https://chromium-review.googlesource.com/c/1437519Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Malay Keshav <malaykeshav@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626262}
parent d928b7d7
...@@ -654,6 +654,8 @@ void StoreDisplayTouchAssociations(PrefService* pref_service) { ...@@ -654,6 +654,8 @@ void StoreDisplayTouchAssociations(PrefService* pref_service) {
DictionaryPrefUpdate update(pref_service, prefs::kDisplayTouchAssociations); DictionaryPrefUpdate update(pref_service, prefs::kDisplayTouchAssociations);
base::DictionaryValue* pref_data = update.Get(); base::DictionaryValue* pref_data = update.Get();
pref_data->Clear();
const display::TouchDeviceManager::TouchAssociationMap& touch_associations = const display::TouchDeviceManager::TouchAssociationMap& touch_associations =
touch_device_manager->touch_associations(); touch_device_manager->touch_associations();
...@@ -703,6 +705,8 @@ void StoreDisplayTouchAssociations(PrefService* pref_service) { ...@@ -703,6 +705,8 @@ void StoreDisplayTouchAssociations(PrefService* pref_service) {
DictionaryPrefUpdate update_port(pref_service, DictionaryPrefUpdate update_port(pref_service,
prefs::kDisplayTouchPortAssociations); prefs::kDisplayTouchPortAssociations);
pref_data = update_port.Get(); pref_data = update_port.Get();
update_port->Clear();
const display::TouchDeviceManager::PortAssociationMap& port_associations = const display::TouchDeviceManager::PortAssociationMap& port_associations =
touch_device_manager->port_associations(); touch_device_manager->port_associations();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment