diff options
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui')
4 files changed, 21 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java index 330333a..cf5d3a6 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java @@ -23,7 +23,6 @@ import android.database.DataSetObserver; import android.graphics.Canvas; import android.util.AttributeSet; import android.util.DisplayMetrics; -import android.util.FloatMath; import android.util.Log; import android.view.MotionEvent; import android.view.View; @@ -368,7 +367,7 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView View child = mAdapter.createView(mLinearLayout); child.measure(childWidthMeasureSpec, childheightMeasureSpec); mNumItemsInOneScreenful = - (int) FloatMath.ceil(dm.widthPixels / (float) child.getMeasuredWidth()); + (int) Math.ceil(dm.widthPixels / (double) child.getMeasuredWidth()); addToRecycledViews(child); for (int i = 0; i < mNumItemsInOneScreenful - 1; i++) { diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java index 1e247be..d518f74 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java @@ -23,7 +23,6 @@ import android.database.DataSetObserver; import android.graphics.Canvas; import android.util.AttributeSet; import android.util.DisplayMetrics; -import android.util.FloatMath; import android.util.Log; import android.view.MotionEvent; import android.view.View; @@ -378,7 +377,7 @@ public class RecentsVerticalScrollView extends ScrollView View child = mAdapter.createView(mLinearLayout); child.measure(childWidthMeasureSpec, childheightMeasureSpec); mNumItemsInOneScreenful = - (int) FloatMath.ceil(dm.heightPixels / (float) child.getMeasuredHeight()); + (int) Math.ceil(dm.heightPixels / (double) child.getMeasuredHeight()); addToRecycledViews(child); for (int i = 0; i < mNumItemsInOneScreenful - 1; i++) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java index 779ff52..04c626b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java @@ -152,7 +152,7 @@ public class Clock extends TextView implements DemoMode { final char MAGIC2 = '\uEF01'; SimpleDateFormat sdf; - String format = is24 ? d.timeFormat24 : d.timeFormat12; + String format = is24 ? d.timeFormat_Hm : d.timeFormat_hm; if (!format.equals(mClockFormatString)) { /* * Search for an unquoted "a" in the format string, so we can diff --git a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java index dce5c37..f804736 100644 --- a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java +++ b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java @@ -28,6 +28,7 @@ import android.os.HandlerThread; import android.os.UserHandle; import android.os.storage.StorageEventListener; import android.os.storage.StorageManager; +import android.os.storage.StorageVolume; import android.provider.Settings; import android.util.Log; @@ -198,6 +199,8 @@ public class StorageNotification extends SystemUI { */ Intent intent = new Intent(); intent.setClass(mContext, com.android.internal.app.ExternalMediaFormatActivity.class); + intent.putExtra(StorageVolume.EXTRA_STORAGE_VOLUME, + getVolumeByPath(mStorageManager.getVolumeList(), path)); PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0); setMediaStorageNotification( @@ -212,6 +215,8 @@ public class StorageNotification extends SystemUI { */ Intent intent = new Intent(); intent.setClass(mContext, com.android.internal.app.ExternalMediaFormatActivity.class); + intent.putExtra(StorageVolume.EXTRA_STORAGE_VOLUME, + getVolumeByPath(mStorageManager.getVolumeList(), path)); PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0); setMediaStorageNotification( @@ -247,6 +252,19 @@ public class StorageNotification extends SystemUI { } /** + * Get the corresponding StorageVolume object for a specific path. + */ + private final StorageVolume getVolumeByPath(StorageVolume[] volumes, String path) { + for (StorageVolume volume : volumes) { + if (volume.getPath().equals(path)) { + return volume; + } + } + Log.w(TAG, "No storage found"); + return null; + } + + /** * Update the state of the USB mass storage notification */ void updateUsbMassStorageNotification(boolean available) { |
