diff options
Diffstat (limited to 'src/com/android/wallpaper/picker/individual/IndividualPickerActivity.java')
-rwxr-xr-x | src/com/android/wallpaper/picker/individual/IndividualPickerActivity.java | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/src/com/android/wallpaper/picker/individual/IndividualPickerActivity.java b/src/com/android/wallpaper/picker/individual/IndividualPickerActivity.java index 367181a..de5ba84 100755 --- a/src/com/android/wallpaper/picker/individual/IndividualPickerActivity.java +++ b/src/com/android/wallpaper/picker/individual/IndividualPickerActivity.java @@ -16,8 +16,6 @@ package com.android.wallpaper.picker.individual; import android.app.Activity; -import android.app.WallpaperManager; -import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.res.Resources.NotFoundException; @@ -44,12 +42,9 @@ import com.android.wallpaper.model.PickerIntentFactory; import com.android.wallpaper.model.WallpaperInfo; import com.android.wallpaper.module.Injector; import com.android.wallpaper.module.InjectorProvider; -import com.android.wallpaper.module.LiveWallpaperStatusChecker; -import com.android.wallpaper.module.NoBackupImageWallpaper; import com.android.wallpaper.module.WallpaperPersister; import com.android.wallpaper.picker.BaseActivity; import com.android.wallpaper.picker.PreviewActivity.PreviewActivityIntentFactory; -import com.android.wallpaper.util.ActivityUtils; import com.android.wallpaper.util.DiskBasedLogger; /** @@ -61,13 +56,11 @@ public class IndividualPickerActivity extends BaseActivity { private static final String EXTRA_CATEGORY_COLLECTION_ID = "com.android.wallpaper.category_collection_id"; private static final int PREVIEW_WALLPAPER_REQUEST_CODE = 0; - private static final int NO_BACKUP_IMAGE_WALLPAPER_REQUEST_CODE = 1; private static final int PREVIEW_LIVEWALLPAPER_REQUEST_CODE = 2; private static final String KEY_CATEGORY_COLLECTION_ID = "key_category_collection_id"; private InlinePreviewIntentFactory mPreviewIntentFactory; private WallpaperPersister mWallpaperPersister; - private LiveWallpaperStatusChecker mLiveWallpaperStatusChecker; private Category mCategory; private String mCategoryCollectionId; @@ -83,7 +76,6 @@ public class IndividualPickerActivity extends BaseActivity { mPreviewIntentFactory = new PreviewActivityIntentFactory(); Injector injector = InjectorProvider.getInjector(); mWallpaperPersister = injector.getWallpaperPersister(this); - mLiveWallpaperStatusChecker = injector.getLiveWallpaperStatusChecker(this); FragmentManager fm = getSupportFragmentManager(); Fragment fragment = fm.findFragmentById(R.id.fragment_container); @@ -160,8 +152,8 @@ public class IndividualPickerActivity extends BaseActivity { public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == android.R.id.home) { - // Handle Up as a Global back since the only entry point to IndividualPickerActivity is from - // TopLevelPickerActivity. + // Handle Up as a Global back since the only entry point to IndividualPickerActivity is + // from TopLevelPickerActivity. onBackPressed(); return true; } @@ -184,18 +176,6 @@ public class IndividualPickerActivity extends BaseActivity { finishWithResultOk(shouldShowMessage); } break; - - case NO_BACKUP_IMAGE_WALLPAPER_REQUEST_CODE: - // User clicked "Set wallpaper" in live wallpaper preview UI. - // NOTE: Don't check for the result code prior to KitKat MR2 because a bug on those versions - // caused the result code to be discarded from LivePicker so we can't rely on it. - if ((!BuildCompat.isAtLeastL() || resultCode == Activity.RESULT_OK) - && mLiveWallpaperStatusChecker.isNoBackupImageWallpaperSet() - && mCategory.getWallpaperRotationInitializer().startRotation(getApplicationContext())) { - finishWithResultOk(true); - } - break; - default: Log.e(TAG, "Invalid request code: " + requestCode); } @@ -211,18 +191,6 @@ public class IndividualPickerActivity extends BaseActivity { : PREVIEW_WALLPAPER_REQUEST_CODE); } - /** - * Shows the system live wallpaper preview for the {@link NoBackupImageWallpaper} which is used to - * draw rotating wallpapers on pre-N Android builds. - */ - public void showNoBackupImageWallpaperPreview() { - Intent intent = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER); - ComponentName componentName = new ComponentName(this, NoBackupImageWallpaper.class); - intent.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT, componentName); - ActivityUtils.startActivityForResultSafely( - this, intent, NO_BACKUP_IMAGE_WALLPAPER_REQUEST_CODE); - } - private void finishWithResultOk(boolean shouldShowMessage) { if (shouldShowMessage) { try { |