Merge "Merge "Update the deletion helper feature factory for photos and videos." into nyc-mr1-dev am: e6d02b6c5e" into nyc-mr1-dev-plus-aosp
am: 71069ded1b
* commit '71069ded1bb7a4a1b8fdb6d4457ece76a930b88d':
Update the deletion helper feature factory for photos and videos.
Change-Id: I0cb8ae3f139ef7a7746d119f8e8c0b16b9277035
This commit is contained in:
@@ -26,8 +26,7 @@ import android.text.format.Formatter;
|
|||||||
* Preference to handle the deletion of photos and videos in the Deletion Helper.
|
* Preference to handle the deletion of photos and videos in the Deletion Helper.
|
||||||
*/
|
*/
|
||||||
public class PhotosDeletionPreference extends DeletionPreference {
|
public class PhotosDeletionPreference extends DeletionPreference {
|
||||||
// TODO(b/28560570): Remove this dummy value.
|
public static final int DAYS_TO_KEEP = 30;
|
||||||
private static final int FAKE_DAYS_TO_KEEP = 30;
|
|
||||||
|
|
||||||
public PhotosDeletionPreference(Context context, AttributeSet attrs) {
|
public PhotosDeletionPreference(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
@@ -42,7 +41,7 @@ public class PhotosDeletionPreference extends DeletionPreference {
|
|||||||
Context context = getContext();
|
Context context = getContext();
|
||||||
setTitle(context.getString(R.string.deletion_helper_photos_title, items));
|
setTitle(context.getString(R.string.deletion_helper_photos_title, items));
|
||||||
setSummary(context.getString(R.string.deletion_helper_photos_summary,
|
setSummary(context.getString(R.string.deletion_helper_photos_summary,
|
||||||
Formatter.formatFileSize(context, bytes), FAKE_DAYS_TO_KEEP));
|
Formatter.formatFileSize(context, bytes), DAYS_TO_KEEP));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -96,7 +96,7 @@ public class DeletionHelperFragment extends SettingsPreferenceFragment implement
|
|||||||
mProvider =
|
mProvider =
|
||||||
FeatureFactory.getFactory(app).getDeletionHelperFeatureProvider();
|
FeatureFactory.getFactory(app).getDeletionHelperFeatureProvider();
|
||||||
if (mProvider != null) {
|
if (mProvider != null) {
|
||||||
mPhotoVideoDeletion = mProvider.createPhotoVideoDeletionType();
|
mPhotoVideoDeletion = mProvider.createPhotoVideoDeletionType(getContext());
|
||||||
}
|
}
|
||||||
mDownloadsDeletion = new DownloadsDeletionType(getActivity());
|
mDownloadsDeletion = new DownloadsDeletionType(getActivity());
|
||||||
|
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.settings.overlay;
|
package com.android.settings.overlay;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.support.v7.preference.PreferenceGroup;
|
import android.support.v7.preference.PreferenceGroup;
|
||||||
import com.android.settings.deletionhelper.DeletionType;
|
import com.android.settings.deletionhelper.DeletionType;
|
||||||
|
|
||||||
@@ -26,5 +27,5 @@ public interface DeletionHelperFeatureProvider {
|
|||||||
/**
|
/**
|
||||||
* Creates a {@link DeletionType} for clearing out stored photos and videos on the device.
|
* Creates a {@link DeletionType} for clearing out stored photos and videos on the device.
|
||||||
*/
|
*/
|
||||||
DeletionType createPhotoVideoDeletionType();
|
DeletionType createPhotoVideoDeletionType(Context context);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user