Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ae795e8 authored by Jesse Evans's avatar Jesse Evans Committed by android-build-merger
Browse files

Merge "Adds the Clear App dialog for Instant Apps" into oc-dev

am: c8e06b3f

Change-Id: I8396ba9d20e25b40044850a532681adbde3e0354
parents 1a8318c7 c8e06b3f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -8607,8 +8607,11 @@
    <string name="storage_percent_full">full</string>
    <!-- Label for button allow user to clear the data for an instant app -->
    <!-- Label for button allow user to remove the instant app from the device. -->
    <string name="clear_instant_app_data">Clear app</string>
    <!-- Confirmation message displayed when the user taps Clear app, to ensure they want to remove
         the instant app from the device. -->
    <string name="clear_instant_app_confirmation">Do you want to remove this instant app?</string>
    <!-- Title of games app storage screen [CHAR LIMIT=30] -->
    <string name="game_storage_settings">Games</string>
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ public interface ApplicationFeatureProvider {
     *  only relevant to instant apps.
     */
    InstantAppButtonsController newInstantAppButtonsController(Fragment fragment,
            View view);
            View view, InstantAppButtonsController.ShowDialogDelegate showDialogDelegate);

    /**
     * Calculates the total number of apps installed on the device via policy in the current user
+2 −2
Original line number Diff line number Diff line
@@ -58,8 +58,8 @@ public class ApplicationFeatureProviderImpl implements ApplicationFeatureProvide

    @Override
    public InstantAppButtonsController newInstantAppButtonsController(Fragment fragment,
            View view) {
        return new InstantAppButtonsController(mContext, fragment, view);
            View view, InstantAppButtonsController.ShowDialogDelegate showDialogDelegate) {
        return new InstantAppButtonsController(mContext, fragment, view, showDialogDelegate);
    }

    @Override
+9 −2
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ import com.android.settings.applications.defaultapps.DefaultEmergencyPreferenceC
import com.android.settings.applications.defaultapps.DefaultHomePreferenceController;
import com.android.settings.applications.defaultapps.DefaultPhonePreferenceController;
import com.android.settings.applications.defaultapps.DefaultSmsPreferenceController;
import com.android.settings.applications.instantapps.InstantAppButtonsController;
import com.android.settings.datausage.AppDataUsage;
import com.android.settings.datausage.DataUsageList;
import com.android.settings.datausage.DataUsageSummary;
@@ -190,6 +191,8 @@ public class InstalledAppDetails extends AppInfoBase
    protected ProcStatsData mStatsManager;
    protected ProcStatsPackageEntry mStats;

    private InstantAppButtonsController mInstantAppButtonsController;

    private AppStorageStats mLastResult;

    private boolean handleDisableable(Button button) {
@@ -771,6 +774,9 @@ public class InstalledAppDetails extends AppInfoBase
                        .setNegativeButton(R.string.dlg_cancel, null)
                        .create();
        }
        if (mInstantAppButtonsController != null) {
            return mInstantAppButtonsController.createDialog(id);
        }
        return null;
    }

@@ -1120,10 +1126,11 @@ public class InstalledAppDetails extends AppInfoBase
        if (AppUtils.isInstant(mPackageInfo.applicationInfo)) {
            LayoutPreference buttons = (LayoutPreference) findPreference(KEY_INSTANT_APP_BUTTONS);
            final Activity activity = getActivity();
            FeatureFactory.getFactory(activity)
            mInstantAppButtonsController = FeatureFactory.getFactory(activity)
                    .getApplicationFeatureProvider(activity)
                    .newInstantAppButtonsController(this,
                            buttons.findViewById(R.id.instant_app_button_container))
                            buttons.findViewById(R.id.instant_app_button_container),
                            id -> showDialogInner(id, 0))
                    .setPackageName(mPackageName)
                    .show();
        }
+7 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.ComponentName;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.content.pm.IPackageDeleteObserver;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.UserHandle;
@@ -98,4 +99,10 @@ public interface PackageManagerWrapper {
     */
    void replacePreferredActivity(IntentFilter homeFilter, int matchCategoryEmpty,
            ComponentName[] componentNames, ComponentName component);

    /**
     * Calls {@code PackageManager.deletePackageAsUser}
     */
    void deletePackageAsUser(String packageName, IPackageDeleteObserver observer, int flags,
            int userId);
}
Loading