Fix 2579923: Make changing lock screen method more discoverable.

This changes the organization of lock screen security settings
to make choosing an alternate unlock method more discoverable.

Instead of having to disable the old lock method to use a new
one, the user now just has one set/change option in lock settings,
with a list of method-specific setting below it.

In addition, we ask the user to confirm their old credentials
before prompting them to choose a new one, which eliminates one
source of confusion.

Also, ChooseLockGeneric now shows a UI if quality isn't specified.
Any unlock method less secure than minimum specified by
DevicePolicyManager (if active) is greyed out.

Change-Id: Iecc6f64d4d3368a583f06f8d5fe9655cc3d5bd3b
This commit is contained in:
Jim Miller
2010-04-08 19:40:19 -07:00
parent 8c8185b260
commit bbb4afa19f
13 changed files with 283 additions and 182 deletions

View File

@@ -25,7 +25,6 @@ import android.view.View;
import android.widget.ImageView;
public class ChooseLockPatternExample extends Activity implements View.OnClickListener {
private static final int REQUESTCODE_CHOOSE = 1;
private static final long START_DELAY = 1000;
protected static final String TAG = "Settings";
private View mNextButton;
@@ -38,26 +37,26 @@ public class ChooseLockPatternExample extends Activity implements View.OnClickLi
startAnimation(mAnimation);
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.choose_lock_pattern_example);
initViews();
}
@Override
protected void onResume() {
super.onResume();
mHandler.postDelayed(mRunnable, START_DELAY);
}
@Override
protected void onPause() {
super.onPause();
stopAnimation(mAnimation);
}
public void onClick(View v) {
if (v == mSkipButton) {
// Canceling, so finish all
@@ -66,37 +65,31 @@ public class ChooseLockPatternExample extends Activity implements View.OnClickLi
} else if (v == mNextButton) {
stopAnimation(mAnimation);
Intent intent = new Intent(this, ChooseLockPattern.class);
startActivityForResult(intent, REQUESTCODE_CHOOSE);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUESTCODE_CHOOSE && resultCode == ChooseLockPattern.RESULT_FINISHED) {
setResult(resultCode);
intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
startActivity(intent);
finish();
}
}
private void initViews() {
mNextButton = findViewById(R.id.next_button);
mNextButton.setOnClickListener(this);
mSkipButton = findViewById(R.id.skip_button);
mSkipButton.setOnClickListener(this);
mImageView = (ImageView) findViewById(R.id.lock_anim);
mImageView.setBackgroundResource(R.drawable.lock_anim);
mImageView.setOnClickListener(this);
mAnimation = (AnimationDrawable) mImageView.getBackground();
}
protected void startAnimation(final AnimationDrawable animation) {
if (animation != null && !animation.isRunning()) {
animation.run();
}
}
protected void stopAnimation(final AnimationDrawable animation) {
if (animation != null && animation.isRunning()) animation.stop();
}