Use explicit APIs to get device owner information

Bug 24676413

Change-Id: Id346c2f01658173c9671edcfd34bc33f1b25faa4
This commit is contained in:
Makoto Onuki
2015-11-19 13:47:55 -08:00
parent 03e1bee786
commit 4cfe39f539
5 changed files with 18 additions and 12 deletions

View File

@@ -47,12 +47,13 @@ public class MonitoringCertInfoActivity extends Activity implements OnClickListe
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.ssl_ca_cert_dialog_title);
builder.setCancelable(true);
hasDeviceOwner = dpm.getDeviceOwner() != null;
// TODO See b/25772443
hasDeviceOwner = dpm.getDeviceOwnerComponentOnCallingUser() != null;
int buttonLabel;
if (hasDeviceOwner) {
// Institutional case. Show informational message.
String message = this.getResources().getString(R.string.ssl_ca_cert_info_message,
dpm.getDeviceOwnerName());
dpm.getDeviceOwnerNameOnAnyUser());
builder.setMessage(message);
buttonLabel = R.string.done_button;
} else {