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

Commit 3cac8028 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add wipe on login failure to Privacy Settings page"

parents c03fb82b 8903f666
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -8166,6 +8166,16 @@
    <string name="enterprise_privacy_lock_device">Admin can lock device and reset password</string>
    <!-- Label explaining that the admin can wipe the device remotely. [CHAR LIMIT=NONE] -->
    <string name="enterprise_privacy_wipe_device">Admin can delete all device data</string>
    <!-- Label explaining that the admin configured the device to wipe itself when the password is mistyped this many times. [CHAR LIMIT=NONE] -->
    <plurals name="enterprise_privacy_failed_password_wipe_device">
        <item quantity="one">Admin set maximum password attempts to <xliff:g id="count">%d</xliff:g> before deleting all device data</item>
        <item quantity="other">Admin set maximum password attempts to <xliff:g id="count">%d</xliff:g> before deleting all device data</item>
    </plurals>
    <!-- Label explaining that the admin configured the work profile to wipe itself when the password is mistyped this many times. [CHAR LIMIT=NONE] -->
    <plurals name="enterprise_privacy_failed_password_wipe_work">
        <item quantity="one">Admin set maximum password attempts to <xliff:g id="count">%d</xliff:g> before deleting work profile data</item>
        <item quantity="other">Admin set maximum password attempts to <xliff:g id="count">%d</xliff:g> before deleting work profile data</item>
    </plurals>
    <!-- Message indicating that the device is enterprise-managed by a Device Owner [CHAR LIMIT=NONE] -->
    <string name="do_disclosure_generic">This device is managed.</string>
    <!-- Message indicating that the device is enterprise-managed by a Device Owner [CHAR LIMIT=NONE] -->
+8 −0
Original line number Diff line number Diff line
@@ -106,5 +106,13 @@
                android:title="@string/enterprise_privacy_wipe_device"
                settings:allowDividerBelow="true"
                settings:multiLine="true"/>
        <com.android.settings.DividerPreference
                android:key="failed_password_wipe_primary_user"
                settings:allowDividerBelow="true"
                settings:multiLine="true"/>
        <com.android.settings.DividerPreference
                android:key="failed_password_wipe_managed_profile"
                settings:allowDividerBelow="true"
                settings:multiLine="true"/>
    </PreferenceCategory>
</PreferenceScreen>
+0 −2
Original line number Diff line number Diff line
@@ -26,12 +26,10 @@ import java.util.Date;

public abstract class AdminActionPreferenceControllerBase extends PreferenceController {

    private final Context mContext;
    protected final EnterprisePrivacyFeatureProvider mFeatureProvider;

    public AdminActionPreferenceControllerBase(Context context) {
        super(context);
        mContext = context;
        mFeatureProvider = FeatureFactory.getFactory(context)
                .getEnterprisePrivacyFeatureProvider(context);
    }
+25 −4
Original line number Diff line number Diff line
@@ -26,6 +26,13 @@ import android.support.annotation.Nullable;
 * newer than the API version supported by Robolectric.
 */
public interface DevicePolicyManagerWrapper {
    /**
     * Calls {@code DevicePolicyManager.getMaximumFailedPasswordsForWipe()}.
     *
     * @see android.app.admin.DevicePolicyManager#getMaximumFailedPasswordsForWipe
     */
    int getMaximumFailedPasswordsForWipe(@Nullable ComponentName admin, int userHandle);

    /**
     * Calls {@code DevicePolicyManager.getDeviceOwnerComponentOnAnyUser()}.
     *
@@ -33,12 +40,26 @@ public interface DevicePolicyManagerWrapper {
     */
    ComponentName getDeviceOwnerComponentOnAnyUser();

    /**
     * Calls {@code DevicePolicyManager.getDeviceOwnerUserId()}.
     *
     * @see android.app.admin.DevicePolicyManager#getDeviceOwnerUserId
     */
    int getDeviceOwnerUserId();

    /**
     * Calls {@code DevicePolicyManager.getProfileOwnerAsUser()}.
     *
     * @see android.app.admin.DevicePolicyManager#getProfileOwnerAsUser
     */
    @Nullable ComponentName getProfileOwnerAsUser(final int userId);

    /**
     * Calls {@code DevicePolicyManager.getDeviceOwnerNameOnAnyUser()}.
     *
     * @see android.app.admin.DevicePolicyManager#getDeviceOwnerNameOnAnyUser
     */
    public CharSequence getDeviceOwnerOrganizationName();
    CharSequence getDeviceOwnerOrganizationName();

    /**
     * Calls {@code DevicePolicyManager.getPermissionGrantState()}.
@@ -53,19 +74,19 @@ public interface DevicePolicyManagerWrapper {
     *
     * @see android.app.admin.DevicePolicyManager#getLastSecurityLogRetrievalTime
     */
    public long getLastSecurityLogRetrievalTime();
    long getLastSecurityLogRetrievalTime();

    /**
     * Calls {@code DevicePolicyManager.getLastBugReportRequestTime()}.
     *
     * @see android.app.admin.DevicePolicyManager#getLastBugReportRequestTime
     */
    public long getLastBugReportRequestTime();
    long getLastBugReportRequestTime();

    /**
     * Calls {@code DevicePolicyManager.getLastNetworkLogRetrievalTime()}.
     *
     * @see android.app.admin.DevicePolicyManager#getLastNetworkLogRetrievalTime
     */
    public long getLastNetworkLogRetrievalTime();
    long getLastNetworkLogRetrievalTime();
}
+15 −0
Original line number Diff line number Diff line
@@ -27,11 +27,26 @@ public class DevicePolicyManagerWrapperImpl implements DevicePolicyManagerWrappe
        mDpm = dpm;
    }

    @Override
    public int getMaximumFailedPasswordsForWipe(@Nullable ComponentName admin, int userHandle) {
        return mDpm.getMaximumFailedPasswordsForWipe(admin, userHandle);
    }

    @Override
    public ComponentName getDeviceOwnerComponentOnAnyUser() {
        return mDpm.getDeviceOwnerComponentOnAnyUser();
    }

    @Override
    public int getDeviceOwnerUserId() {
        return mDpm.getDeviceOwnerUserId();
    }

    @Override
    public @Nullable ComponentName getProfileOwnerAsUser(final int userId) {
        return mDpm.getProfileOwnerAsUser(userId);
    }

    @Override
    public CharSequence getDeviceOwnerOrganizationName() {
        return mDpm.getDeviceOwnerOrganizationName();
Loading