Loading core/java/android/app/ActivityView.java +35 −12 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.app; import android.content.Context; import android.content.Context; import android.content.ContextWrapper; import android.content.ContextWrapper; import android.content.IIntentSender; import android.content.Intent; import android.content.Intent; import android.content.IntentSender; import android.content.IntentSender; import android.graphics.SurfaceTexture; import android.graphics.SurfaceTexture; Loading @@ -43,6 +44,10 @@ public class ActivityView extends ViewGroup { private int mHeight; private int mHeight; private Surface mSurface; private Surface mSurface; // Only one IIntentSender or Intent may be queued at a time. Most recent one wins. IIntentSender mQueuedPendingIntent; Intent mQueuedIntent; public ActivityView(Context context) { public ActivityView(Context context) { this(context, null); this(context, null); } } Loading Loading @@ -118,28 +123,38 @@ public class ActivityView extends ViewGroup { } catch (RemoteException e) { } catch (RemoteException e) { throw new IllegalStateException("ActivityView: Unable to startActivity. " + e); throw new IllegalStateException("ActivityView: Unable to startActivity. " + e); } } } else { mQueuedIntent = intent; mQueuedPendingIntent = null; } } } } public void startActivity(IntentSender intentSender) { private void startActivityIntentSender(IIntentSender iIntentSender) { if (mSurface != null) { try { try { mActivityContainer.startActivityIntentSender(intentSender.getTarget()); mActivityContainer.startActivityIntentSender(iIntentSender); } catch (RemoteException e) { } catch (RemoteException e) { throw new IllegalStateException( throw new IllegalStateException( "ActivityView: Unable to startActivity from IntentSender. " + e); "ActivityView: Unable to startActivity from IntentSender. " + e); } } } } public void startActivity(IntentSender intentSender) { final IIntentSender iIntentSender = intentSender.getTarget(); if (mSurface != null) { startActivityIntentSender(iIntentSender); } else { mQueuedPendingIntent = iIntentSender; mQueuedIntent = null; } } } public void startActivity(PendingIntent pendingIntent) { public void startActivity(PendingIntent pendingIntent) { final IIntentSender iIntentSender = pendingIntent.getTarget(); if (mSurface != null) { if (mSurface != null) { try { startActivityIntentSender(iIntentSender); mActivityContainer.startActivityIntentSender(pendingIntent.getTarget()); } else { } catch (RemoteException e) { mQueuedPendingIntent = iIntentSender; throw new IllegalStateException( mQueuedIntent = null; "ActivityView: Unable to startActivity from PendingIntent. " + e); } } } } } Loading @@ -163,6 +178,14 @@ public class ActivityView extends ViewGroup { throw new IllegalStateException( throw new IllegalStateException( "ActivityView: Unable to create ActivityContainer. " + e); "ActivityView: Unable to create ActivityContainer. " + e); } } if (mQueuedIntent != null) { startActivity(mQueuedIntent); mQueuedIntent = null; } else if (mQueuedPendingIntent != null) { startActivityIntentSender(mQueuedPendingIntent); mQueuedPendingIntent = null; } } } private void detach() { private void detach() { Loading Loading
core/java/android/app/ActivityView.java +35 −12 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.app; import android.content.Context; import android.content.Context; import android.content.ContextWrapper; import android.content.ContextWrapper; import android.content.IIntentSender; import android.content.Intent; import android.content.Intent; import android.content.IntentSender; import android.content.IntentSender; import android.graphics.SurfaceTexture; import android.graphics.SurfaceTexture; Loading @@ -43,6 +44,10 @@ public class ActivityView extends ViewGroup { private int mHeight; private int mHeight; private Surface mSurface; private Surface mSurface; // Only one IIntentSender or Intent may be queued at a time. Most recent one wins. IIntentSender mQueuedPendingIntent; Intent mQueuedIntent; public ActivityView(Context context) { public ActivityView(Context context) { this(context, null); this(context, null); } } Loading Loading @@ -118,28 +123,38 @@ public class ActivityView extends ViewGroup { } catch (RemoteException e) { } catch (RemoteException e) { throw new IllegalStateException("ActivityView: Unable to startActivity. " + e); throw new IllegalStateException("ActivityView: Unable to startActivity. " + e); } } } else { mQueuedIntent = intent; mQueuedPendingIntent = null; } } } } public void startActivity(IntentSender intentSender) { private void startActivityIntentSender(IIntentSender iIntentSender) { if (mSurface != null) { try { try { mActivityContainer.startActivityIntentSender(intentSender.getTarget()); mActivityContainer.startActivityIntentSender(iIntentSender); } catch (RemoteException e) { } catch (RemoteException e) { throw new IllegalStateException( throw new IllegalStateException( "ActivityView: Unable to startActivity from IntentSender. " + e); "ActivityView: Unable to startActivity from IntentSender. " + e); } } } } public void startActivity(IntentSender intentSender) { final IIntentSender iIntentSender = intentSender.getTarget(); if (mSurface != null) { startActivityIntentSender(iIntentSender); } else { mQueuedPendingIntent = iIntentSender; mQueuedIntent = null; } } } public void startActivity(PendingIntent pendingIntent) { public void startActivity(PendingIntent pendingIntent) { final IIntentSender iIntentSender = pendingIntent.getTarget(); if (mSurface != null) { if (mSurface != null) { try { startActivityIntentSender(iIntentSender); mActivityContainer.startActivityIntentSender(pendingIntent.getTarget()); } else { } catch (RemoteException e) { mQueuedPendingIntent = iIntentSender; throw new IllegalStateException( mQueuedIntent = null; "ActivityView: Unable to startActivity from PendingIntent. " + e); } } } } } Loading @@ -163,6 +178,14 @@ public class ActivityView extends ViewGroup { throw new IllegalStateException( throw new IllegalStateException( "ActivityView: Unable to create ActivityContainer. " + e); "ActivityView: Unable to create ActivityContainer. " + e); } } if (mQueuedIntent != null) { startActivity(mQueuedIntent); mQueuedIntent = null; } else if (mQueuedPendingIntent != null) { startActivityIntentSender(mQueuedPendingIntent); mQueuedPendingIntent = null; } } } private void detach() { private void detach() { Loading