summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/com/android/internal/app/ChooserActivity.java82
-rw-r--r--core/java/com/android/internal/app/ResolverActivity.java9
-rw-r--r--core/java/com/android/internal/app/chooser/DisplayResolveInfo.java5
-rw-r--r--core/java/com/android/internal/app/chooser/SelectableTargetInfo.java3
4 files changed, 4 insertions, 95 deletions
diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java
index 96728ed89b70..a316669aa516 100644
--- a/core/java/com/android/internal/app/ChooserActivity.java
+++ b/core/java/com/android/internal/app/ChooserActivity.java
@@ -152,18 +152,6 @@ public class ChooserActivity extends ResolverActivity implements
SelectableTargetInfoCommunicator {
private static final String TAG = "ChooserActivity";
- /**
- * Whether this chooser is operating in "headless springboard" mode (as determined during
- * onCreate). In this mode, our activity sits in the background and waits for the new
- * "unbundled" chooser to handle the Sharesheet experience; the system ChooserActivity is
- * responsible only for providing the startActivityAsCaller permission token and keeping it
- * valid for the life of the unbundled delegate activity.
- *
- * TODO: when the unbundled chooser is fully launched, the system-side "springboard" can use a
- * simpler implementation that doesn't inherit from ResolverActivity.
- */
- private boolean mIsHeadlessSpringboardActivity;
-
private AppPredictor mPersonalAppPredictor;
private AppPredictor mWorkAppPredictor;
private boolean mShouldDisplayLandscape;
@@ -259,11 +247,6 @@ public class ChooserActivity extends ResolverActivity implements
private static final float DIRECT_SHARE_EXPANSION_RATE = 0.78f;
- private boolean mEnableChooserDelegate =
- DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SYSTEMUI,
- SystemUiDeviceConfigFlags.USE_DELEGATE_CHOOSER,
- false);
-
private static final int DEFAULT_SALT_EXPIRATION_DAYS = 7;
private int mMaxHashSaltDays = DeviceConfig.getInt(DeviceConfig.NAMESPACE_SYSTEMUI,
SystemUiDeviceConfigFlags.HASH_SALT_MAX_DAYS,
@@ -530,12 +513,6 @@ public class ChooserActivity extends ResolverActivity implements
@Override
protected void onCreate(Bundle savedInstanceState) {
- if (handOverToDelegateChooser()) {
- super_onCreate(savedInstanceState);
- mIsHeadlessSpringboardActivity = true;
- return;
- }
-
final long intentReceivedTime = System.currentTimeMillis();
getChooserActivityLogger().logSharesheetTriggered();
// This is the only place this value is being set. Effectively final.
@@ -751,56 +728,6 @@ public class ChooserActivity extends ResolverActivity implements
postponeEnterTransition();
}
- private boolean handOverToDelegateChooser() {
- // Check the explicit classname so that we don't interfere with the flow of any subclasses.
- if (!this.getClass().getName().equals("com.android.internal.app.ChooserActivity")
- || !mEnableChooserDelegate) {
- return false;
- }
-
- Intent delegationIntent = new Intent();
- final ComponentName delegateActivity = ComponentName.unflattenFromString(
- Resources.getSystem().getString(R.string.config_chooserActivity));
- delegationIntent.setComponent(delegateActivity);
- delegationIntent.putExtra(Intent.EXTRA_INTENT, getIntent());
- delegationIntent.addFlags(Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP);
-
- // Don't close until the delegate finishes, or the token will be invalidated.
- mAwaitingDelegateResponse = true;
- startActivityForResult(delegationIntent, REQUEST_CODE_RETURN_FROM_DELEGATE_CHOOSER);
- return true;
- }
-
- @Override
- protected void onRestart() {
- if (mIsHeadlessSpringboardActivity) {
- super_onRestart();
- return;
- }
-
- super.onRestart();
- }
-
- @Override
- protected void onSaveInstanceState(Bundle outState) {
- if (mIsHeadlessSpringboardActivity) {
- super_onSaveInstanceState(outState);
- return;
- }
-
- super.onSaveInstanceState(outState);
- }
-
- @Override
- protected void onRestoreInstanceState(Bundle savedInstanceState) {
- if (mIsHeadlessSpringboardActivity) {
- super_onRestoreInstanceState(savedInstanceState);
- return;
- }
-
- super.onRestoreInstanceState(savedInstanceState);
- }
-
@Override
protected int appliedThemeResId() {
return R.style.Theme_DeviceDefault_Chooser;
@@ -1059,11 +986,6 @@ public class ChooserActivity extends ResolverActivity implements
@Override
public void onConfigurationChanged(Configuration newConfig) {
- if (mIsHeadlessSpringboardActivity) {
- super_onConfigurationChanged(newConfig);
- return;
- }
-
super.onConfigurationChanged(newConfig);
ViewPager viewPager = findViewById(R.id.profile_pager);
if (viewPager.isLayoutRtl()) {
@@ -1616,10 +1538,6 @@ public class ChooserActivity extends ResolverActivity implements
protected void onDestroy() {
super.onDestroy();
- if (mIsHeadlessSpringboardActivity) {
- return;
- }
-
if (mRefinementResultReceiver != null) {
mRefinementResultReceiver.destroy();
mRefinementResultReceiver = null;
diff --git a/core/java/com/android/internal/app/ResolverActivity.java b/core/java/com/android/internal/app/ResolverActivity.java
index dc68e16e2eb6..1815ca69a55c 100644
--- a/core/java/com/android/internal/app/ResolverActivity.java
+++ b/core/java/com/android/internal/app/ResolverActivity.java
@@ -1458,15 +1458,6 @@ public class ResolverActivity extends Activity implements
.write();
}
-
- public boolean startAsCallerImpl(Intent intent, Bundle options, boolean ignoreTargetSecurity,
- int userId) {
- // Note: this method will be overridden in the delegate implementation to use the passed-in
- // permission token.
- startActivityAsCaller(intent, options, false, userId);
- return true;
- }
-
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
diff --git a/core/java/com/android/internal/app/chooser/DisplayResolveInfo.java b/core/java/com/android/internal/app/chooser/DisplayResolveInfo.java
index dc53e77466ad..5ebc9154023c 100644
--- a/core/java/com/android/internal/app/chooser/DisplayResolveInfo.java
+++ b/core/java/com/android/internal/app/chooser/DisplayResolveInfo.java
@@ -173,9 +173,8 @@ public class DisplayResolveInfo implements TargetInfo, Parcelable {
@Override
public boolean startAsCaller(ResolverActivity activity, Bundle options, int userId) {
- // TODO: if the start-as-caller API no longer requires a permission token, this can go back
- // to inlining the real activity-start call, and we can remove startAsCallerImpl.
- return activity.startAsCallerImpl(mResolvedIntent, options, false, userId);
+ activity.startActivityAsCaller(mResolvedIntent, options, false, userId);
+ return true;
}
@Override
diff --git a/core/java/com/android/internal/app/chooser/SelectableTargetInfo.java b/core/java/com/android/internal/app/chooser/SelectableTargetInfo.java
index 8a19f2d2aa4e..015336388b5d 100644
--- a/core/java/com/android/internal/app/chooser/SelectableTargetInfo.java
+++ b/core/java/com/android/internal/app/chooser/SelectableTargetInfo.java
@@ -241,7 +241,8 @@ public final class SelectableTargetInfo implements ChooserTargetInfo {
final boolean ignoreTargetSecurity = mSourceInfo != null
&& mSourceInfo.getResolvedComponentName().getPackageName()
.equals(mChooserTarget.getComponentName().getPackageName());
- return activity.startAsCallerImpl(intent, options, ignoreTargetSecurity, userId);
+ activity.startActivityAsCaller(intent, options, ignoreTargetSecurity, userId);
+ return true;
}
@Override