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

Commit 8aee45af authored by Steven Ng's avatar Steven Ng Committed by Android (Google) Code Review
Browse files

Merge "Disable "disable" button for the device provision app in the Settings app" into nyc-mr1-dev

parents 77fc052d 54ce1da4
Loading
Loading
Loading
Loading
+15 −1
Original line number Original line Diff line number Diff line
@@ -102,7 +102,6 @@ import com.android.settingslib.net.ChartDataLoader;


import java.lang.ref.WeakReference;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.HashSet;
import java.util.List;
import java.util.List;


@@ -231,6 +230,11 @@ public class InstalledAppDetails extends AppInfoBase
            enabled = false;
            enabled = false;
        }
        }


        // Don't allow uninstalling the device provisioning package.
        if (isDeviceProvisioningPackage(mAppEntry.info.packageName)) {
            enabled = false;
        }

        // If the uninstall intent is already queued, disable the uninstall button
        // If the uninstall intent is already queued, disable the uninstall button
        if (mDpm.isUninstallInQueue(mPackageName)) {
        if (mDpm.isUninstallInQueue(mPackageName)) {
            enabled = false;
            enabled = false;
@@ -298,6 +302,16 @@ public class InstalledAppDetails extends AppInfoBase
        return false;
        return false;
    }
    }


    /**
     * Returns {@code true} if the supplied package is the device provisioning app. Otherwise,
     * returns {@code false}.
     */
    private boolean isDeviceProvisioningPackage(String packageName) {
        String deviceProvisioningPackage = getResources().getString(
                com.android.internal.R.string.config_deviceProvisioningPackage);
        return deviceProvisioningPackage != null && deviceProvisioningPackage.equals(packageName);
    }

    /** Called when the activity is first created. */
    /** Called when the activity is first created. */
    @Override
    @Override
    public void onCreate(Bundle icicle) {
    public void onCreate(Bundle icicle) {