diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-03-26 13:24:39 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2010-03-26 13:24:39 -0700 |
commit | 39e64e76c14f6ad0a844cea6c9ea9865f0b9261e (patch) | |
tree | 58485746178d80732379ffad322e7e9e6e8211fb | |
parent | 449708b123bf06566e08684d553ec2d6e6ebc270 (diff) | |
download | packages_apps_settings-39e64e76c14f6ad0a844cea6c9ea9865f0b9261e.zip packages_apps_settings-39e64e76c14f6ad0a844cea6c9ea9865f0b9261e.tar.gz packages_apps_settings-39e64e76c14f6ad0a844cea6c9ea9865f0b9261e.tar.bz2 |
API council: don't allow admin add from new task.
Change-Id: I45f75f8e2c43ba0dae51d37e104d18d0b1a2cdbf
-rw-r--r-- | src/com/android/settings/DeviceAdminAdd.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/settings/DeviceAdminAdd.java b/src/com/android/settings/DeviceAdminAdd.java index 2653e81..4760277 100644 --- a/src/com/android/settings/DeviceAdminAdd.java +++ b/src/com/android/settings/DeviceAdminAdd.java @@ -27,6 +27,7 @@ import android.app.admin.DevicePolicyManager; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; +import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; @@ -81,6 +82,12 @@ public class DeviceAdminAdd extends Activity { mDPM = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE); + if ((getIntent().getFlags()&Intent.FLAG_ACTIVITY_NEW_TASK) != 0) { + Log.w(TAG, "Can now start ADD_DEVICE_ADMIN as a new task"); + finish(); + return; + } + ComponentName cn = (ComponentName)getIntent().getParcelableExtra( DevicePolicyManager.EXTRA_DEVICE_ADMIN); if (cn == null) { |