diff --git a/src/com/android/settings/applications/AppHeaderController.java b/src/com/android/settings/applications/AppHeaderController.java index 45938ae467c..804d645967a 100644 --- a/src/com/android/settings/applications/AppHeaderController.java +++ b/src/com/android/settings/applications/AppHeaderController.java @@ -52,15 +52,13 @@ public class AppHeaderController { @IntDef({ActionType.ACTION_NONE, ActionType.ACTION_APP_INFO, ActionType.ACTION_APP_PREFERENCE, - ActionType.ACTION_STORE_DEEP_LINK, ActionType.ACTION_NOTIF_PREFERENCE}) @Retention(RetentionPolicy.SOURCE) public @interface ActionType { int ACTION_NONE = 0; int ACTION_APP_INFO = 1; - int ACTION_STORE_DEEP_LINK = 2; - int ACTION_APP_PREFERENCE = 3; - int ACTION_NOTIF_PREFERENCE = 4; + int ACTION_APP_PREFERENCE = 2; + int ACTION_NOTIF_PREFERENCE = 3; } public static final String PREF_KEY_APP_HEADER = "pref_app_header"; @@ -254,20 +252,6 @@ public class AppHeaderController { } return; } - case ActionType.ACTION_STORE_DEEP_LINK: { - final Intent intent = new Intent(Intent.ACTION_SHOW_APP_INFO) - .setPackage(getInstallerPackageName(mContext, mPackageName)); - final Intent result = resolveIntent(intent); - if (result == null) { - button.setVisibility(View.GONE); - } else { - result.putExtra(Intent.EXTRA_PACKAGE_NAME, mPackageName); - button.setImageResource(R.drawable.ic_sim_sd); - button.setOnClickListener(v -> mFragment.startActivity(intent)); - button.setVisibility(View.VISIBLE); - } - return; - } case ActionType.ACTION_NOTIF_PREFERENCE: { if (mAppNotifPrefIntent == null) { button.setVisibility(View.GONE); @@ -295,15 +279,6 @@ public class AppHeaderController { } } - private String getInstallerPackageName(Context context, String packageName) { - try { - return context.getPackageManager().getInstallerPackageName(packageName); - } catch (IllegalArgumentException e) { - Log.e(TAG, "Exception while retrieving the package installer of " + packageName, e); - return null; - } - } - private Intent resolveIntent(Intent i) { ResolveInfo result = mContext.getPackageManager().resolveActivity(i, 0); if (result != null) { diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java index 09771f2f0a5..16621f49302 100755 --- a/src/com/android/settings/applications/InstalledAppDetails.java +++ b/src/com/android/settings/applications/InstalledAppDetails.java @@ -415,8 +415,8 @@ public class InstalledAppDetails extends AppInfoBase .getApplicationFeatureProvider(activity) .newAppHeaderController(this, mHeader.findViewById(R.id.app_snippet)) .setPackageName(mPackageName) - .setButtonActions(AppHeaderController.ActionType.ACTION_STORE_DEEP_LINK, - AppHeaderController.ActionType.ACTION_APP_PREFERENCE) + .setButtonActions(AppHeaderController.ActionType.ACTION_APP_PREFERENCE, + AppHeaderController.ActionType.ACTION_NONE) .styleActionBar(activity) .bindAppHeaderButtons(); prepareUninstallAndStop(); diff --git a/tests/robotests/src/com/android/settings/applications/AppHeaderControllerTest.java b/tests/robotests/src/com/android/settings/applications/AppHeaderControllerTest.java index 37a75213373..8b9b4b46c32 100644 --- a/tests/robotests/src/com/android/settings/applications/AppHeaderControllerTest.java +++ b/tests/robotests/src/com/android/settings/applications/AppHeaderControllerTest.java @@ -18,7 +18,6 @@ package com.android.settings.applications; import static com.google.common.truth.Truth.assertThat; - import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyInt; import static org.mockito.Matchers.eq; @@ -171,25 +170,6 @@ public class AppHeaderControllerTest { .isEqualTo(View.GONE); } - @Test - public void bindButton_noStoreLink_shouldNotShowButton() { - final View appLinks = mLayoutInflater - .inflate(R.layout.app_details, null /* root */); - when(mContext.getPackageManager().resolveActivity(any(Intent.class), anyInt())) - .thenReturn(null); - - mController = new AppHeaderController(mContext, mFragment, appLinks); - mController.setButtonActions( - AppHeaderController.ActionType.ACTION_STORE_DEEP_LINK, - AppHeaderController.ActionType.ACTION_NONE); - mController.done(mActivity); - - assertThat(appLinks.findViewById(R.id.left_button).getVisibility()) - .isEqualTo(View.GONE); - assertThat(appLinks.findViewById(R.id.right_button).getVisibility()) - .isEqualTo(View.GONE); - } - @Test public void bindButton_noAppInfo_shouldNotShowButton() { final View appLinks = mLayoutInflater