From cc1a267b0160440ddc96d47e5af1f418a2a2fda3 Mon Sep 17 00:00:00 2001 From: Leon Scroggins Date: Thu, 21 Jan 2010 16:25:26 -0500 Subject: [PATCH] Use the common method for updating the title. Depends on a change in frameworks/base --- src/com/android/browser/BrowserDownloadAdapter.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/com/android/browser/BrowserDownloadAdapter.java b/src/com/android/browser/BrowserDownloadAdapter.java index 974e8fa..2a3b69c 100644 --- a/src/com/android/browser/BrowserDownloadAdapter.java +++ b/src/com/android/browser/BrowserDownloadAdapter.java @@ -17,8 +17,6 @@ package com.android.browser; -import android.content.ContentUris; -import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; @@ -38,7 +36,6 @@ import android.widget.ProgressBar; import android.widget.RelativeLayout; import android.widget.TextView; -import java.io.File; import java.text.DateFormat; import java.util.Date; import java.util.List; @@ -120,13 +117,8 @@ public class BrowserDownloadAdapter extends DateSortedExpandableListAdapter { title = r.getString(R.string.download_unknown_filename); } else { // We have a filename, so we can build a title from that - title = new File(fullFilename).getName(); - ContentValues values = new ContentValues(); - values.put(Downloads.Impl.COLUMN_TITLE, title); - // assume "_id" is the first column for the cursor - context.getContentResolver().update( - ContentUris.withAppendedId(Downloads.Impl.CONTENT_URI, - getLong(0)), values, null, null); + title = Downloads.Impl.createTitleFromFilename(context, fullFilename, + getLong(0)); } } tv.setText(title); -- 2.11.0