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

Commit 04e245b1 authored by Andrei Stingaceanu's avatar Andrei Stingaceanu
Browse files

Wire in the device owner info into the KeyguardStatusView

Display the device owner information if it has been provisioned by
DPC via DevicePolicyManager, else fallback into displaying the
current user owner information (if set).

Change-Id: Ie915d6669ecac06bfa7b57079b9dcd0fac56df57
parent bfd22908
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.keyguard;

import android.app.ActivityManager;
import android.app.AlarmManager;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -198,13 +197,19 @@ public class KeyguardStatusView extends GridLayout {
    }

    private String getOwnerInfo() {
        ContentResolver res = getContext().getContentResolver();
        String info = null;
        if (mLockPatternUtils.isDeviceOwnerInfoEnabled()) {
            // Use the device owner information set by device policy client via
            // device policy manager.
            info = mLockPatternUtils.getDeviceOwnerInfo();
        } else {
            // Use the current user owner information if enabled.
            final boolean ownerInfoEnabled = mLockPatternUtils.isOwnerInfoEnabled(
                    KeyguardUpdateMonitor.getCurrentUser());
            if (ownerInfoEnabled) {
                info = mLockPatternUtils.getOwnerInfo(KeyguardUpdateMonitor.getCurrentUser());
            }
        }
        return info;
    }