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

Commit 4adb9d34 authored by Amith Yamasani's avatar Amith Yamasani Committed by Android (Google) Code Review
Browse files

Merge "DevicePolicyManager per user" into jb-mr1-dev

parents 2d95a33d 599dd7ce
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -413,6 +413,13 @@ public final class PendingIntent implements Parcelable {
     */
    public static PendingIntent getBroadcast(Context context, int requestCode,
            Intent intent, int flags) {
        return getBroadcastAsUser(context, requestCode, intent, flags,
                new UserHandle(UserHandle.myUserId()));
    }

    /** @hide */
    public static PendingIntent getBroadcastAsUser(Context context, int requestCode,
            Intent intent, int flags, UserHandle userHandle) {
        String packageName = context.getPackageName();
        String resolvedType = intent != null ? intent.resolveTypeIfNeeded(
                context.getContentResolver()) : null;
@@ -423,7 +430,7 @@ public final class PendingIntent implements Parcelable {
                    ActivityManager.INTENT_SENDER_BROADCAST, packageName,
                    null, null, requestCode, new Intent[] { intent },
                    resolvedType != null ? new String[] { resolvedType } : null,
                    flags, null, UserHandle.myUserId());
                    flags, null, userHandle.getIdentifier());
            return target != null ? new PendingIntent(target) : null;
        } catch (RemoteException e) {
        }
+124 −52

File changed.

Preview size limit exceeded, changes collapsed.

+48 −48

File changed.

Preview size limit exceeded, changes collapsed.

+75 −36

File changed.

Preview size limit exceeded, changes collapsed.

+3 −2
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.os.Looper;
import android.os.UserHandle;
import android.os.UserManager;
import android.util.AttributeSet;
import android.util.Log;
@@ -345,7 +346,7 @@ public class KeyguardHostView extends KeyguardViewBase {
        final boolean usingPattern = mode == KeyguardSecurityModel.SecurityMode.Pattern;

        final int failedAttemptsBeforeWipe = mLockPatternUtils.getDevicePolicyManager()
                .getMaximumFailedPasswordsForWipe(null);
                .getMaximumFailedPasswordsForWipe(null, mLockPatternUtils.getCurrentUser());

        final int failedAttemptWarning = LockPatternUtils.FAILED_ATTEMPTS_BEFORE_RESET
                - LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT;
@@ -683,7 +684,7 @@ public class KeyguardHostView extends KeyguardViewBase {
    private void maybePopulateWidgets() {
        DevicePolicyManager dpm =
                (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
        if (dpm != null && dpm.getKeyguardWidgetsDisabled(null)
        if (dpm != null && dpm.getKeyguardWidgetsDisabled(null, mLockPatternUtils.getCurrentUser())
                != DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_NONE) {
            Log.v(TAG, "Keyguard widgets disabled because of device policy admin");
            return;
Loading