From 4f93e19ddb504560752fd5da9fecc4b95a4f1733 Mon Sep 17 00:00:00 2001 From: Spike Sprague Date: Tue, 19 Aug 2014 18:53:41 -0700 Subject: filmstrip actionbar tweaks bug: 17114274 Change-Id: I0e9b3dd37325d39f5a16d81cbfaf71b98baf7510 --- src_pd/com/android/camera/util/GalleryHelper.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src_pd') diff --git a/src_pd/com/android/camera/util/GalleryHelper.java b/src_pd/com/android/camera/util/GalleryHelper.java index 0a4af7da7..0092ffaf2 100644 --- a/src_pd/com/android/camera/util/GalleryHelper.java +++ b/src_pd/com/android/camera/util/GalleryHelper.java @@ -15,19 +15,23 @@ */ package com.android.camera.util; +import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; import android.net.Uri; +import com.android.camera2.R; + /** * A helper class to provide Gallery related info. */ public class GalleryHelper { - private static final String GALLERY_PACKAGE_NAME = "com.google.android.apps.plus"; + private static final String GALLERY_PACKAGE_NAME = "com.android.gallery3d"; private static final String GALLERY_ACTIVITY_CLASS = - "com.google.android.apps.photos.phone.PhotosLauncherActivity"; + "com.android.gallery3d.app.GalleryActivity"; + private static final int GALLERY_APP_NAME_ID = R.string.gallery_app_name; public static void setGalleryIntentClassName(Intent intent) { intent.setClassName(GALLERY_PACKAGE_NAME, GALLERY_ACTIVITY_CLASS); @@ -44,6 +48,17 @@ public class GalleryHelper { return null; } + public static CharSequence getGalleryAppName(Context context, Intent galleryIntent) { + ComponentName componentName = galleryIntent.getComponent(); + if (componentName != null + && GALLERY_PACKAGE_NAME.equals(componentName.getPackageName()) + && GALLERY_ACTIVITY_CLASS.equals(componentName.getClassName())) { + return context.getResources().getString(GALLERY_APP_NAME_ID); + } else { + return null; + } + } + public static void setContentUri(Intent intent, Uri uri) { // Do nothing. } -- cgit v1.2.3