Loading src/com/android/settings/DeviceAdminAdd.java +19 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,9 @@ public class DeviceAdminAdd extends Activity { public static final String EXTRA_DEVICE_ADMIN_PACKAGE_NAME = "android.app.extra.DEVICE_ADMIN_PACKAGE_NAME"; public static final String EXTRA_CALLED_FROM_SUPPORT_DIALOG = "android.app.extra.CALLED_FROM_SUPPORT_DIALOG"; Handler mHandler; DevicePolicyManager mDPM; Loading Loading @@ -113,6 +116,8 @@ public class DeviceAdminAdd extends Activity { int mCurSysAppOpMode; int mCurToastAppOpMode; boolean mIsCalledFromSupportDialog = false; @Override protected void onCreate(Bundle icicle) { super.onCreate(icicle); Loading @@ -129,6 +134,8 @@ public class DeviceAdminAdd extends Activity { return; } mIsCalledFromSupportDialog = getIntent().getBooleanExtra( EXTRA_CALLED_FROM_SUPPORT_DIALOG, false); String action = getIntent().getAction(); ComponentName who = (ComponentName)getIntent().getParcelableExtra( Loading Loading @@ -458,6 +465,18 @@ public class DeviceAdminAdd extends Activity { } } @Override protected void onUserLeaveHint() { super.onUserLeaveHint(); // In case this is triggered from support dialog, finish this activity once the user leaves // so that this won't appear as a background next time support dialog is triggered. This // is because the support dialog activity and this belong to the same task and we can't // start this in new activity since we need to know the calling package in this activity. if (mIsCalledFromSupportDialog) { finish(); } } @Override protected Dialog onCreateDialog(int id, Bundle args) { switch (id) { Loading src/com/android/settings/ShowAdminSupportDetailsDialog.java +1 −0 Original line number Diff line number Diff line Loading @@ -155,6 +155,7 @@ public class ShowAdminSupportDetailsDialog extends Activity intent.setClass(activity, DeviceAdminAdd.class); intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, enforcedAdmin.component); intent.putExtra(DeviceAdminAdd.EXTRA_CALLED_FROM_SUPPORT_DIALOG, true); // DeviceAdminAdd class may need to run as managed profile. activity.startActivityAsUser(intent, new UserHandle(enforcedAdmin.userId)); Loading Loading
src/com/android/settings/DeviceAdminAdd.java +19 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,9 @@ public class DeviceAdminAdd extends Activity { public static final String EXTRA_DEVICE_ADMIN_PACKAGE_NAME = "android.app.extra.DEVICE_ADMIN_PACKAGE_NAME"; public static final String EXTRA_CALLED_FROM_SUPPORT_DIALOG = "android.app.extra.CALLED_FROM_SUPPORT_DIALOG"; Handler mHandler; DevicePolicyManager mDPM; Loading Loading @@ -113,6 +116,8 @@ public class DeviceAdminAdd extends Activity { int mCurSysAppOpMode; int mCurToastAppOpMode; boolean mIsCalledFromSupportDialog = false; @Override protected void onCreate(Bundle icicle) { super.onCreate(icicle); Loading @@ -129,6 +134,8 @@ public class DeviceAdminAdd extends Activity { return; } mIsCalledFromSupportDialog = getIntent().getBooleanExtra( EXTRA_CALLED_FROM_SUPPORT_DIALOG, false); String action = getIntent().getAction(); ComponentName who = (ComponentName)getIntent().getParcelableExtra( Loading Loading @@ -458,6 +465,18 @@ public class DeviceAdminAdd extends Activity { } } @Override protected void onUserLeaveHint() { super.onUserLeaveHint(); // In case this is triggered from support dialog, finish this activity once the user leaves // so that this won't appear as a background next time support dialog is triggered. This // is because the support dialog activity and this belong to the same task and we can't // start this in new activity since we need to know the calling package in this activity. if (mIsCalledFromSupportDialog) { finish(); } } @Override protected Dialog onCreateDialog(int id, Bundle args) { switch (id) { Loading
src/com/android/settings/ShowAdminSupportDetailsDialog.java +1 −0 Original line number Diff line number Diff line Loading @@ -155,6 +155,7 @@ public class ShowAdminSupportDetailsDialog extends Activity intent.setClass(activity, DeviceAdminAdd.class); intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, enforcedAdmin.component); intent.putExtra(DeviceAdminAdd.EXTRA_CALLED_FROM_SUPPORT_DIALOG, true); // DeviceAdminAdd class may need to run as managed profile. activity.startActivityAsUser(intent, new UserHandle(enforcedAdmin.userId)); Loading