Push BrailleBack 0.9_r4.

git-svn-id: https://eyes-free.googlecode.com/svn/trunk/braille/client/src/com/googlecode/eyesfree/braille@788 584082c0-ab3a-11dd-9ddb-6f86aeb5eef6
diff --git a/display/BrailleDisplayProperties.java b/display/BrailleDisplayProperties.java
index f61bad0..606476f 100644
--- a/display/BrailleDisplayProperties.java
+++ b/display/BrailleDisplayProperties.java
@@ -19,6 +19,10 @@
 import android.os.Parcel;
 import android.os.Parcelable;
 
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * Properties of a braille display such as dimensions and keyboard
  * configuration.
@@ -27,12 +31,15 @@
     private final int mNumTextCells;
     private final int mNumStatusCells;
     private final BrailleKeyBinding[] mKeyBindings;
+    private final Map<String, String> mFriendlyKeyNames;
 
     public BrailleDisplayProperties(int numTextCells, int numStatusCells,
-            BrailleKeyBinding[] keyBindings) {
+            BrailleKeyBinding[] keyBindings,
+            Map<String, String> friendlyKeyNames) {
         mNumTextCells = numTextCells;
         mNumStatusCells = numStatusCells;
         mKeyBindings = keyBindings;
+        mFriendlyKeyNames = friendlyKeyNames;
     }
 
     /**
@@ -59,6 +66,14 @@
         return mKeyBindings;
     }
 
+    /**
+     * Returns an unmodifiable map mapping key names in {@link BrailleKeyBinding}
+     * objects to localized user-friendly key names.
+     */
+    public Map<String, String> getFriendlyKeyNames() {
+        return mFriendlyKeyNames;
+    }
+
     @Override
     public String toString() {
         return String.format(
@@ -92,11 +107,22 @@
         out.writeInt(mNumTextCells);
         out.writeInt(mNumStatusCells);
         out.writeTypedArray(mKeyBindings, flags);
+        out.writeInt(mFriendlyKeyNames.size());
+        for (Map.Entry<String, String> entry : mFriendlyKeyNames.entrySet()) {
+            out.writeString(entry.getKey());
+            out.writeString(entry.getValue());
+        }
     }
 
     private BrailleDisplayProperties(Parcel in) {
         mNumTextCells = in.readInt();
         mNumStatusCells = in.readInt();
         mKeyBindings = in.createTypedArray(BrailleKeyBinding.CREATOR);
+        int size = in.readInt();
+        Map<String, String> names = new HashMap<String, String>(size);
+        for (int i = 0; i < size; ++i) {
+            names.put(in.readString(), in.readString());
+        }
+        mFriendlyKeyNames = Collections.unmodifiableMap(names);
     }
 }