Allow for screen density drawables in compatibility mode.

This change allows us to use drawables that match the current screen
density even when being loaded in compatibility mode.  In this case,
the bitmap is loaded in the screen density, and the bitmap and
nine-patch drawables take care of accounting for the density difference.

This should be safe for existing applications, for the most part, since
they shouldn't really be pulling the bitmap out of the drawable.  For
the small rare chance of them breaking, it worth getting the correct
graphics.  Also this will only happen when there is actually a resource
of the matching density, and no existing apps should have resources for
anything besides the default density (though of course all of the
framework resources will be available in the native density).

As part of this, the bitmap density API has been changed to a single
integer provider the DPI unit density.
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index ff8868b..7ed2712 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -46,6 +46,7 @@
 import android.os.SystemProperties;
 import android.util.AttributeSet;
 import android.util.Config;
+import android.util.DisplayMetrics;
 import android.util.EventLog;
 import android.util.Log;
 import android.util.Pool;
@@ -5976,6 +5977,7 @@
 
                 try {
                     bitmap = Bitmap.createBitmap(width, height, quality);
+                    bitmap.setDensity(getResources().getDisplayMetrics().densityDpi);
                     if (autoScale) {
                         mDrawingCache = new SoftReference<Bitmap>(bitmap);
                     } else {