summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/ActivityTransitionCoordinator.java16
-rw-r--r--core/java/android/app/EnterTransitionCoordinator.java8
-rw-r--r--core/java/android/net/MobileDataStateTracker.java2
-rw-r--r--core/java/android/os/Build.java28
-rw-r--r--core/java/android/os/Process.java10
-rw-r--r--core/java/android/service/notification/ConditionProviderService.java58
-rw-r--r--core/java/android/tv/TvInputService.java9
7 files changed, 91 insertions, 40 deletions
diff --git a/core/java/android/app/ActivityTransitionCoordinator.java b/core/java/android/app/ActivityTransitionCoordinator.java
index f96c3e3..3c1455b 100644
--- a/core/java/android/app/ActivityTransitionCoordinator.java
+++ b/core/java/android/app/ActivityTransitionCoordinator.java
@@ -206,6 +206,7 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
private ResultReceiver mRemoteResultReceiver;
private boolean mNotifiedSharedElementTransitionComplete;
private boolean mNotifiedExitTransitionComplete;
+ private boolean mSharedElementTransitionStarted;
private FixedEpicenterCallback mEpicenterCallback = new FixedEpicenterCallback();
@@ -250,7 +251,11 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
onPrepareRestore();
break;
case MSG_EXIT_TRANSITION_COMPLETE:
- onRemoteSceneExitComplete();
+ if (!mSharedElementTransitionStarted) {
+ send(resultCode, resultData);
+ } else {
+ onRemoteSceneExitComplete();
+ }
break;
case MSG_TAKE_SHARED_ELEMENTS:
ArrayList<String> sharedElementNames
@@ -456,9 +461,13 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
mTargetSharedNames.clear();
if (sharedElements == null) {
ArrayMap<String, View> map = new ArrayMap<String, View>();
- setViewVisibility(mEnteringViews, View.VISIBLE);
+ if (getViewsTransition() != null) {
+ setViewVisibility(mEnteringViews, View.VISIBLE);
+ }
getDecor().findSharedElements(map);
- setViewVisibility(mEnteringViews, View.INVISIBLE);
+ if (getViewsTransition() != null) {
+ setViewVisibility(mEnteringViews, View.INVISIBLE);
+ }
for (int i = 0; i < map.size(); i++) {
View view = map.valueAt(i);
String name = map.keyAt(i);
@@ -582,6 +591,7 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
getDecor().getViewTreeObserver().removeOnPreDrawListener(this);
mListener.onCaptureSharedElementEnd(mTargetSharedNames, mSharedElements,
acceptedOverlayViews);
+ mSharedElementTransitionStarted = true;
return true;
}
}
diff --git a/core/java/android/app/EnterTransitionCoordinator.java b/core/java/android/app/EnterTransitionCoordinator.java
index 0798529..c26e68a 100644
--- a/core/java/android/app/EnterTransitionCoordinator.java
+++ b/core/java/android/app/EnterTransitionCoordinator.java
@@ -135,11 +135,6 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator
}
@Override
- protected void onRemoteSceneExitComplete() {
- super.onRemoteSceneExitComplete();
- }
-
- @Override
protected void onTakeSharedElements(ArrayList<String> sharedElementNames, Bundle state) {
mEnteringSharedElementNames = new ArrayList<String>();
mEnteringSharedElementNames.addAll(sharedElementNames);
@@ -149,6 +144,7 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator
@Override
protected void sharedElementTransitionComplete(Bundle bundle) {
notifySharedElementTransitionComplete(bundle);
+ exitAfterSharedElementTransition();
}
@Override
@@ -280,7 +276,7 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator
}
private void exitAfterSharedElementTransition() {
- if (mSharedElementTransitionComplete && mExitTransitionComplete) {
+ if (mSharedElementTransitionComplete && mExitTransitionComplete && mBackgroundFadedOut) {
mActivity.finish();
if (mSupportsTransition) {
mActivity.overridePendingTransition(0, 0);
diff --git a/core/java/android/net/MobileDataStateTracker.java b/core/java/android/net/MobileDataStateTracker.java
index a470e88..30b61c5 100644
--- a/core/java/android/net/MobileDataStateTracker.java
+++ b/core/java/android/net/MobileDataStateTracker.java
@@ -54,7 +54,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
public class MobileDataStateTracker extends BaseNetworkStateTracker {
private static final String TAG = "MobileDataStateTracker";
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
private static final boolean VDBG = false;
private PhoneConstants.DataState mMobileDataState;
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index 0336dd6..1ca6b90 100644
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -81,12 +81,38 @@ public class Build {
public static final String SERIAL = getString("ro.serialno");
/**
- * A list of ABIs (in priority) order supported by this device.
+ * An ordered list of ABIs supported by this device. The most preferred ABI is the first
+ * element in the list.
+ *
+ * See {@link #SUPPORTED_32_BIT_ABIS} and {@link #SUPPORTED_64_BIT_ABIS}.
*
* @hide
*/
public static final String[] SUPPORTED_ABIS = getString("ro.product.cpu.abilist").split(",");
+ /**
+ * An ordered list of <b>32 bit</b> ABIs supported by this device. The most preferred ABI
+ * is the first element in the list.
+ *
+ * See {@link #SUPPORTED_ABIS} and {@link #SUPPORTED_64_BIT_ABIS}.
+ *
+ * @hide
+ */
+ public static final String[] SUPPORTED_32_BIT_ABIS = getString("ro.product.cpu.abilist32")
+ .split(",");
+
+ /**
+ * An ordered list of <b>64 bit</b> ABIs supported by this device. The most preferred ABI
+ * is the first element in the list.
+ *
+ * See {@link #SUPPORTED_ABIS} and {@link #SUPPORTED_32_BIT_ABIS}.
+ *
+ * @hide
+ */
+ public static final String[] SUPPORTED_64_BIT_ABIS = getString("ro.product.cpu.abilist64")
+ .split(",");
+
+
/** Various version strings. */
public static class VERSION {
/**
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java
index b4ed68c..1b3aa0a 100644
--- a/core/java/android/os/Process.java
+++ b/core/java/android/os/Process.java
@@ -707,16 +707,6 @@ public class Process {
return primaryZygoteState;
}
- // TODO: Get rid of this. This is a temporary workaround until all the
- // compilation related pieces for the dual zygote stack are ready.
- // b/3647418.
- if (System.getenv("ANDROID_SOCKET_" + SECONDARY_ZYGOTE_SOCKET) == null) {
- Log.e(LOG_TAG, "Forcing app to primary zygote, secondary unavailable (ABI= " + abi + ")");
- // Should be :
- // throw new ZygoteStartFailedEx("Unsupported zygote ABI: " + abi);
- return primaryZygoteState;
- }
-
// The primary zygote didn't match. Try the secondary.
if (secondaryZygoteState == null || secondaryZygoteState.isClosed()) {
secondaryZygoteState = ZygoteState.connect(SECONDARY_ZYGOTE_SOCKET,
diff --git a/core/java/android/service/notification/ConditionProviderService.java b/core/java/android/service/notification/ConditionProviderService.java
index d6ef8f5..326412f 100644
--- a/core/java/android/service/notification/ConditionProviderService.java
+++ b/core/java/android/service/notification/ConditionProviderService.java
@@ -22,7 +22,9 @@ import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
+import android.os.Handler;
import android.os.IBinder;
+import android.os.Message;
import android.os.ServiceManager;
import android.util.Log;
@@ -46,6 +48,8 @@ public abstract class ConditionProviderService extends Service {
private final String TAG = ConditionProviderService.class.getSimpleName()
+ "[" + getClass().getSimpleName() + "]";
+ private final H mHandler = new H();
+
private Provider mProvider;
private INotificationManager mNoMan;
@@ -100,41 +104,57 @@ public abstract class ConditionProviderService extends Service {
}
private final class Provider extends IConditionProvider.Stub {
- private final ConditionProviderService mService = ConditionProviderService.this;
-
@Override
public void onConnected() {
- try {
- mService.onConnected();
- } catch (Throwable t) {
- Log.w(TAG, "Error running onConnected", t);
- }
+ mHandler.obtainMessage(H.ON_CONNECTED).sendToTarget();
}
@Override
public void onRequestConditions(int relevance) {
- try {
- mService.onRequestConditions(relevance);
- } catch (Throwable t) {
- Log.w(TAG, "Error running onRequestConditions", t);
- }
+ mHandler.obtainMessage(H.ON_REQUEST_CONDITIONS, relevance, 0).sendToTarget();
}
@Override
public void onSubscribe(Uri conditionId) {
- try {
- mService.onSubscribe(conditionId);
- } catch (Throwable t) {
- Log.w(TAG, "Error running onSubscribe", t);
- }
+ mHandler.obtainMessage(H.ON_SUBSCRIBE, conditionId).sendToTarget();
}
@Override
public void onUnsubscribe(Uri conditionId) {
+ mHandler.obtainMessage(H.ON_UNSUBSCRIBE, conditionId).sendToTarget();
+ }
+ }
+
+ private final class H extends Handler {
+ private static final int ON_CONNECTED = 1;
+ private static final int ON_REQUEST_CONDITIONS = 2;
+ private static final int ON_SUBSCRIBE = 3;
+ private static final int ON_UNSUBSCRIBE = 4;
+
+ @Override
+ public void handleMessage(Message msg) {
+ String name = null;
try {
- mService.onUnsubscribe(conditionId);
+ switch(msg.what) {
+ case ON_CONNECTED:
+ name = "onConnected";
+ onConnected();
+ break;
+ case ON_REQUEST_CONDITIONS:
+ name = "onRequestConditions";
+ onRequestConditions(msg.arg1);
+ break;
+ case ON_SUBSCRIBE:
+ name = "onSubscribe";
+ onSubscribe((Uri)msg.obj);
+ break;
+ case ON_UNSUBSCRIBE:
+ name = "onUnsubscribe";
+ onUnsubscribe((Uri)msg.obj);
+ break;
+ }
} catch (Throwable t) {
- Log.w(TAG, "Error running onUnsubscribe", t);
+ Log.w(TAG, "Error running " + name, t);
}
}
}
diff --git a/core/java/android/tv/TvInputService.java b/core/java/android/tv/TvInputService.java
index 636e3b4..70e7f95 100644
--- a/core/java/android/tv/TvInputService.java
+++ b/core/java/android/tv/TvInputService.java
@@ -150,6 +150,7 @@ public abstract class TvInputService extends Service {
private final KeyEvent.DispatcherState mDispatcherState = new KeyEvent.DispatcherState();
private final WindowManager mWindowManager;
private WindowManager.LayoutParams mWindowParams;
+ private Surface mSurface;
private View mOverlayView;
private boolean mOverlayViewEnabled;
private IBinder mWindowToken;
@@ -346,6 +347,10 @@ public abstract class TvInputService extends Service {
*/
void release() {
onRelease();
+ if (mSurface != null) {
+ mSurface.release();
+ mSurface = null;
+ }
removeOverlayView(true);
}
@@ -354,6 +359,10 @@ public abstract class TvInputService extends Service {
*/
void setSurface(Surface surface) {
onSetSurface(surface);
+ if (mSurface != null) {
+ mSurface.release();
+ }
+ mSurface = surface;
// TODO: Handle failure.
}