summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuli Huang <yuli@google.com>2012-08-06 17:55:30 +0800
committerYuli Huang <yuli@google.com>2012-08-07 16:10:21 +0800
commit778ec3597e00cd048224b2c393e2d925bfb27c57 (patch)
tree1eae4d5791364c04b28a36c9f47b4e7fe2126c44
parent211807ba43ac5a93e94130a1256cc0423fff0e37 (diff)
downloadandroid_packages_apps_Gallery2-778ec3597e00cd048224b2c393e2d925bfb27c57.tar.gz
android_packages_apps_Gallery2-778ec3597e00cd048224b2c393e2d925bfb27c57.tar.bz2
android_packages_apps_Gallery2-778ec3597e00cd048224b2c393e2d925bfb27c57.zip
Do not show photo editor before api level 14.
bug:6927717 Change-Id: Iab0fddaa169e03b65dd0a987ee8b5c892f971000
-rw-r--r--AndroidManifest.xml3
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/ApiHelper.java3
-rw-r--r--src/com/android/gallery3d/app/GalleryAppImpl.java10
3 files changed, 15 insertions, 1 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 2b89dca7f..612b90ec7 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -212,7 +212,8 @@
android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen"
android:configChanges="keyboardHidden|orientation|screenSize"
android:hardwareAccelerated="true"
- android:process=":edit">
+ android:process=":edit"
+ android:enabled="false">
<intent-filter>
<action android:name="android.intent.action.EDIT" />
<data android:mimeType="image/*" />
diff --git a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
index f95fb81df..dcea0e420 100644
--- a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
+++ b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
@@ -38,6 +38,9 @@ public class ApiHelper {
public static final int JELLY_BEAN = 16;
}
+ public static final boolean ENABLE_PHOTO_EDITOR =
+ Build.VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH;
+
public static final boolean HAS_VIEW_SYSTEM_UI_FLAG_LAYOUT_STABLE =
hasField(View.class, "SYSTEM_UI_FLAG_LAYOUT_STABLE");
diff --git a/src/com/android/gallery3d/app/GalleryAppImpl.java b/src/com/android/gallery3d/app/GalleryAppImpl.java
index f725ccf5a..0164bce65 100644
--- a/src/com/android/gallery3d/app/GalleryAppImpl.java
+++ b/src/com/android/gallery3d/app/GalleryAppImpl.java
@@ -17,12 +17,16 @@
package com.android.gallery3d.app;
import android.app.Application;
+import android.content.ComponentName;
import android.content.Context;
+import android.content.pm.PackageManager;
+import com.android.gallery3d.common.ApiHelper;
import com.android.gallery3d.data.DataManager;
import com.android.gallery3d.data.DownloadCache;
import com.android.gallery3d.data.ImageCacheService;
import com.android.gallery3d.gadget.WidgetUtils;
+import com.android.gallery3d.photoeditor.PhotoEditor;
import com.android.gallery3d.picasasource.PicasaSource;
import com.android.gallery3d.util.GalleryUtils;
import com.android.gallery3d.util.ThreadPool;
@@ -47,6 +51,12 @@ public class GalleryAppImpl extends Application implements GalleryApp {
GalleryUtils.initialize(this);
WidgetUtils.initialize(this);
PicasaSource.initialize(this);
+ int state = ApiHelper.ENABLE_PHOTO_EDITOR
+ ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
+ : PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
+ getPackageManager().setComponentEnabledSetting(
+ new ComponentName(this, PhotoEditor.class),
+ state, PackageManager.DONT_KILL_APP);
}
@Override