summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorLikai Ding <likaid@codeaurora.org>2016-05-20 14:21:43 +0800
committerLikai Ding <likaid@codeaurora.org>2016-06-03 15:39:39 +0800
commit4dc5e6d88c57ca9ab34169572fbef104293bbe82 (patch)
tree745ac090d61d85a7a91df8cff111e49860a9dd9f /src/com/android
parentfdb52c1657054bc3ae54c6006a8fd2807a6d7137 (diff)
downloadandroid_packages_apps_Gallery2-4dc5e6d88c57ca9ab34169572fbef104293bbe82.tar.gz
android_packages_apps_Gallery2-4dc5e6d88c57ca9ab34169572fbef104293bbe82.tar.bz2
android_packages_apps_Gallery2-4dc5e6d88c57ca9ab34169572fbef104293bbe82.zip
Gallery: remove calls to @hide and internal API/members
CRs-Fixed: 986672 Change-Id: Ib7b9eb494da9c38191f75960f01e62dfbf356205
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/gallery3d/app/GestureController.java2
-rw-r--r--src/com/android/gallery3d/app/GestureControllerOverlay.java6
-rw-r--r--src/com/android/gallery3d/app/MovieControllerOverlay.java21
-rw-r--r--src/com/android/gallery3d/app/MoviePlayer.java2
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java5
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java1
-rw-r--r--src/com/android/gallery3d/util/GalleryUtils.java22
7 files changed, 23 insertions, 36 deletions
diff --git a/src/com/android/gallery3d/app/GestureController.java b/src/com/android/gallery3d/app/GestureController.java
index 51ca04d3d..22deb6706 100644
--- a/src/com/android/gallery3d/app/GestureController.java
+++ b/src/com/android/gallery3d/app/GestureController.java
@@ -159,7 +159,7 @@ public class GestureController {
// decide which process is needed.
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
- mStartEvent = event.copy();
+ mStartEvent = MotionEvent.obtain(event);
break;
case MotionEvent.ACTION_MOVE:
if (mType == Type.NONE && mStartEvent != null) {
diff --git a/src/com/android/gallery3d/app/GestureControllerOverlay.java b/src/com/android/gallery3d/app/GestureControllerOverlay.java
index 6ac278608..38b7f0d65 100644
--- a/src/com/android/gallery3d/app/GestureControllerOverlay.java
+++ b/src/com/android/gallery3d/app/GestureControllerOverlay.java
@@ -223,7 +223,7 @@ public class GestureControllerOverlay extends FrameLayout implements
adjustPercent = 1.0f;
}
- WindowManager.LayoutParams lp = ((MovieActivity) mContext).getWindow().getAttributes();
+ WindowManager.LayoutParams lp = ((MovieActivity) getContext()).getWindow().getAttributes();
if (mStartBrightness < 0) {
mStartBrightness = lp.screenBrightness;
}
@@ -234,7 +234,7 @@ public class GestureControllerOverlay extends FrameLayout implements
targetBrightness = 1.0f;
}
lp.screenBrightness = targetBrightness;
- ((MovieActivity) mContext).getWindow().setAttributes(lp);
+ ((MovieActivity) getContext()).getWindow().setAttributes(lp);
if (mCurrentIndicator != null) {
mCurrentIndicator.setCompoundDrawables(null, mBrightnessDrawable, null, null);
@@ -251,7 +251,7 @@ public class GestureControllerOverlay extends FrameLayout implements
adjustPercent = 1.0f;
}
- AudioManager audioManager = (AudioManager) mContext
+ AudioManager audioManager = (AudioManager) getContext()
.getSystemService(Context.AUDIO_SERVICE);
final int STREAM = AudioManager.STREAM_MUSIC;
int maxVolume = audioManager.getStreamMaxVolume(STREAM);
diff --git a/src/com/android/gallery3d/app/MovieControllerOverlay.java b/src/com/android/gallery3d/app/MovieControllerOverlay.java
index e1a3d0282..80a7fc6aa 100644
--- a/src/com/android/gallery3d/app/MovieControllerOverlay.java
+++ b/src/com/android/gallery3d/app/MovieControllerOverlay.java
@@ -17,11 +17,9 @@
package com.android.gallery3d.app;
import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Rect;
-import android.graphics.drawable.VectorDrawable;
+import android.graphics.drawable.Drawable;
import android.media.MediaPlayer;
import android.os.Handler;
import android.text.TextUtils;
@@ -691,9 +689,11 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
}
// for screen layout
- VectorDrawable screenButton = VectorDrawable.create(context.getResources(),
- R.drawable.ic_media_bigscreen);
- mScreenWidth = screenButton.getIntrinsicWidth();
+ Drawable screenButton = context.getResources()
+ .getDrawable(R.drawable.ic_media_bigscreen, null);
+ if (screenButton != null) {
+ mScreenWidth = screenButton.getIntrinsicWidth();
+ }
mScreenPadding = (int) (metrics.density * MARGIN);
}
@@ -780,9 +780,12 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements
void init(Context context) {
Log.v(TAG, "ControllerRewindAndForwardExt init");
mTimeBarHeight = mTimeBar.getPreferredHeight();
- VectorDrawable drawable =
- VectorDrawable.create(context.getResources(), R.drawable.ic_menu_forward);
- mButtonWidth = drawable.getIntrinsicWidth();
+
+ Drawable forwardMenu = context.getResources().
+ getDrawable(R.drawable.ic_menu_forward, null);
+ if (forwardMenu != null) {
+ mButtonWidth = forwardMenu.getIntrinsicWidth();
+ }
mContollerButtons = new LinearLayout(context);
LinearLayout.LayoutParams wrapContent = new LinearLayout.LayoutParams(
diff --git a/src/com/android/gallery3d/app/MoviePlayer.java b/src/com/android/gallery3d/app/MoviePlayer.java
index 520b462ee..f0d6a1ce7 100644
--- a/src/com/android/gallery3d/app/MoviePlayer.java
+++ b/src/com/android/gallery3d/app/MoviePlayer.java
@@ -645,7 +645,7 @@ public class MoviePlayer implements
Log.v(TAG, "playVideo()");
}
- if (GalleryUtils.isTelephonyCallInProgress()) {
+ if (GalleryUtils.isTelephonyCallInProgress(mContext)) {
Log.w(TAG, "CS/CSVT Call is in progress, can't play video");
return false;
}
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 50f813276..624c0a80e 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -26,7 +26,6 @@ import android.content.pm.PackageManager;
import android.content.res.Configuration;
//import android.drm.DrmHelper;
import android.graphics.Rect;
-import android.media.MediaFile;
import android.net.Uri;
import android.nfc.NfcAdapter;
import android.nfc.NfcAdapter.CreateBeamUrisCallback;
@@ -1204,7 +1203,7 @@ public abstract class PhotoPage extends ActivityState implements
Intent intent = new Intent(mActivity, TrimVideo.class);
intent.setData(manager.getContentUri(path));
// We need the file path to wrap this into a RandomAccessFile.
- String str = android.media.MediaFile.getMimeTypeForFile(current.getFilePath());
+ String str = current.getMimeType();
if("video/mp4".equals(str) || "video/mpeg4".equals(str)
|| "video/3gpp".equals(str) || "video/3gpp2".equals(str)) {
intent.putExtra(KEY_MEDIA_ITEM_PATH, current.getFilePath());
@@ -1388,7 +1387,7 @@ public abstract class PhotoPage extends ActivityState implements
}
public void playVideo(Activity activity, Uri uri, String title) {
- if (GalleryUtils.isTelephonyCallInProgress()) {
+ if (GalleryUtils.isTelephonyCallInProgress(mActivity)) {
Log.w(TAG, "CS/CSVT Call is in progress, can't play video");
return;
}
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index c1395170b..21962424a 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -526,7 +526,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
public void setActionBar() {
ActionBar actionBar = getActionBar();
- actionBar.setShowHideAnimationEnabled(false);
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
actionBar.setBackgroundDrawable(new ColorDrawable(getResources()
.getColor(R.color.edit_actionbar_background)));
diff --git a/src/com/android/gallery3d/util/GalleryUtils.java b/src/com/android/gallery3d/util/GalleryUtils.java
index 6a511273a..a0580016b 100644
--- a/src/com/android/gallery3d/util/GalleryUtils.java
+++ b/src/com/android/gallery3d/util/GalleryUtils.java
@@ -34,7 +34,6 @@ import android.os.Environment;
import android.os.StatFs;
import android.preference.PreferenceManager;
import android.provider.MediaStore;
-import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.util.Log;
@@ -48,7 +47,6 @@ import com.android.gallery3d.common.ApiHelper;
import com.android.gallery3d.data.DataManager;
import com.android.gallery3d.data.MediaItem;
import com.android.gallery3d.ui.TiledScreenNail;
-import com.android.gallery3d.util.IntentHelper;
import com.android.gallery3d.util.ThreadPool.CancelListener;
import com.android.gallery3d.util.ThreadPool.JobContext;
@@ -439,21 +437,9 @@ public class GalleryUtils {
ed.commit();
}
- public static boolean isTelephonyCallInProgress() {
- TelephonyManager telephonyManager = TelephonyManager.getDefault();
-
- int count = telephonyManager.getPhoneCount();
- for (int i = 0; i < count; i++) {
- int[] subId = SubscriptionManager.getSubId(i);
- if (subId != null && subId.length > 0) {
- int telephony_state = telephonyManager.getCallState(subId[0]);
-
- if (telephony_state == TelephonyManager.CALL_STATE_OFFHOOK
- || telephony_state == TelephonyManager.CALL_STATE_RINGING) {
- return true;
- }
- }
- }
- return false;
+ public static boolean isTelephonyCallInProgress(Context context) {
+ TelephonyManager telephonyManager =
+ (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
+ return telephonyManager.getCallState() != TelephonyManager.CALL_STATE_IDLE;
}
}