Revert "dragon: Exclude invalid/non-updatable firmwares from keyboard update service"

This reverts commit aa506aa0d56d11d082b419f6c74348efd81ed112.

Change-Id: If8dada6b0a0d9452899aa1d2d669044df27076ba
diff --git a/DragonKeyboardFirmwareUpdater/keyboard_firmware_updater/res/values/strings.xml b/DragonKeyboardFirmwareUpdater/keyboard_firmware_updater/res/values/strings.xml
index 7589952..58a4533 100644
--- a/DragonKeyboardFirmwareUpdater/keyboard_firmware_updater/res/values/strings.xml
+++ b/DragonKeyboardFirmwareUpdater/keyboard_firmware_updater/res/values/strings.xml
@@ -26,7 +26,6 @@
     <string name="target_manufacturer" translatable="false">Google</string>
     <string name="target_battery_level" translatable="false">20</string>
     <string name="target_firmware_version" translatable="false">0.151104</string>
-    <string name="target_min_updatable_firmware_version" translatable="false">0.151020</string>
 
     <!-- File names of the firmware images in raw resource (for service use)-->
     <string name="target_firmware_init_file_name" translatable="false">init_151104_mp_signed</string>
diff --git a/DragonKeyboardFirmwareUpdater/keyboard_firmware_updater/src/com/android/dragonkeyboardfirmwareupdater/KeyboardFirmwareUpdateService.java b/DragonKeyboardFirmwareUpdater/keyboard_firmware_updater/src/com/android/dragonkeyboardfirmwareupdater/KeyboardFirmwareUpdateService.java
index 72d2351..325abc4 100644
--- a/DragonKeyboardFirmwareUpdater/keyboard_firmware_updater/src/com/android/dragonkeyboardfirmwareupdater/KeyboardFirmwareUpdateService.java
+++ b/DragonKeyboardFirmwareUpdater/keyboard_firmware_updater/src/com/android/dragonkeyboardfirmwareupdater/KeyboardFirmwareUpdateService.java
@@ -282,29 +282,11 @@
                 Log.d(TAG, "onCharacteristicRead DEVICE_INFORMATION_FIRMWARE_VERSION_CHARACTERISTIC: current: "
                         + mKeyboardFirmwareVersion + " new: " + getString(R.string.target_firmware_version));
 
-                Float versionNumber = 0.0f;
-                // Parse the firmware version into Float number for the following checks.
-                try {
-                    versionNumber = Float.parseFloat(mKeyboardFirmwareVersion);
-                } catch(NumberFormatException e) {
-                    Log.w(TAG, "onCharacteristicRead DEVICE_INFORMATION_FIRMWARE_VERSION_CHARACTERISTIC: " +
-                          "firmware version parsing error");
-                    changeDfuStatus(DFU_STATE_INFO_NOT_SUITABLE);
-                    return;
-                }
-
-                // Check if the current firmware is updatable.
-                if (versionNumber < Float.parseFloat(getString(R.string.target_min_updatable_firmware_version))) {
+                // TODO(mcchou): update target_fimware_version
+                if (Float.parseFloat(mKeyboardFirmwareVersion) >= Float.parseFloat(getString(R.string.target_firmware_version))) {
                     Log.d(TAG, "onCharacteristicRead DEVICE_INFORMATION_FIRMWARE_VERSION_CHARACTERISTIC: " +
-                          "current firmware(" + mKeyboardFirmwareVersion + ") is not updatable");
-                    changeDfuStatus(DFU_STATE_INFO_NOT_SUITABLE);
-                    return;
-                }
-
-                // Check if the current firmware is up to date.
-                if (versionNumber >= Float.parseFloat(getString(R.string.target_firmware_version))) {
-                    Log.d(TAG, "onCharacteristicRead DEVICE_INFORMATION_FIRMWARE_VERSION_CHARACTERISTIC: " +
-                            getKeyboardString() + " firmware(" + mKeyboardFirmwareVersion + ") is up to date");
+                            getKeyboardString() + " firmware(" + mKeyboardFirmwareVersion +
+                            ") is up to date");
                     changeDfuStatus(DFU_STATE_INFO_NOT_SUITABLE);
                     return;
                 }