diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-03-03 17:18:13 -0800 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2010-03-03 17:18:13 -0800 |
commit | 97de6bccfe81655a16feb988da1d208f95a8d6e3 (patch) | |
tree | 5b0d660f0d7abe3df67c6b6b4939617a6262ee82 | |
parent | 65daa5f593a2ed59805a629cba4767ae89771bc8 (diff) | |
download | packages_apps_Settings-97de6bccfe81655a16feb988da1d208f95a8d6e3.zip packages_apps_Settings-97de6bccfe81655a16feb988da1d208f95a8d6e3.tar.gz packages_apps_Settings-97de6bccfe81655a16feb988da1d208f95a8d6e3.tar.bz2 |
Fix issue #2477264: "Force Stop" in "Manage Applications" is not working
Also add cancel button when adding a device admin.
-rw-r--r-- | res/layout/device_admin_add.xml | 9 | ||||
-rw-r--r-- | src/com/android/settings/DeviceAdminAdd.java | 7 | ||||
-rw-r--r-- | src/com/android/settings/InstalledAppDetails.java | 8 |
3 files changed, 17 insertions, 7 deletions
diff --git a/res/layout/device_admin_add.xml b/res/layout/device_admin_add.xml index 3ff190b..f560331 100644 --- a/res/layout/device_admin_add.xml +++ b/res/layout/device_admin_add.xml @@ -104,5 +104,14 @@ android:layout_width="0dip" android:layout_height="0dip" android:layout_weight="1" /> + <Button android:id="@+id/cancel_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/cancel" /> + <View + android:layout_width="0dip" + android:layout_height="0dip" + android:layout_weight="1" /> </LinearLayout> </LinearLayout> diff --git a/src/com/android/settings/DeviceAdminAdd.java b/src/com/android/settings/DeviceAdminAdd.java index d953409..2653e81 100644 --- a/src/com/android/settings/DeviceAdminAdd.java +++ b/src/com/android/settings/DeviceAdminAdd.java @@ -64,6 +64,7 @@ public class DeviceAdminAdd extends Activity { TextView mAdminWarning; ViewGroup mAdminPolicies; Button mActionButton; + Button mCancelButton; View mSelectLayout; @@ -133,6 +134,12 @@ public class DeviceAdminAdd extends Activity { mAddMsg = (TextView)findViewById(R.id.add_msg); mAdminWarning = (TextView)findViewById(R.id.admin_warning); mAdminPolicies = (ViewGroup)findViewById(R.id.admin_policies); + mCancelButton = (Button)findViewById(R.id.cancel_button); + mCancelButton.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + finish(); + } + }); mActionButton = (Button)findViewById(R.id.action_button); mActionButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { diff --git a/src/com/android/settings/InstalledAppDetails.java b/src/com/android/settings/InstalledAppDetails.java index 67f2f8f..128d1cd 100644 --- a/src/com/android/settings/InstalledAppDetails.java +++ b/src/com/android/settings/InstalledAppDetails.java @@ -592,6 +592,7 @@ public class InstalledAppDetails extends Activity implements View.OnClickListene @Override public void onReceive(Context context, Intent intent) { mForceStopButton.setEnabled(getResultCode() != RESULT_CANCELED); + mForceStopButton.setOnClickListener(InstalledAppDetails.this); } }; @@ -634,13 +635,6 @@ public class InstalledAppDetails extends Activity implements View.OnClickListene } mPm.deleteApplicationCacheFiles(packageName, mClearCacheObserver); } else if (v == mForceStopButton) { - // TODO Once framework supports a pre-broadcast to - // actually find out if an application will be restarted right - // after its killed, there is no way we can determine if - // a force stop will really kill the app. So just ignore - // the dialog for now and force stop the package. Please note - // that the button cannot be enabled or disabled since - // we do not have this info for now. forceStopPackage(mAppInfo.packageName); } else if (v == mMoveAppButton) { if (mPackageMoveObserver == null) { |