Get encryption working for phones.
I've removed the "special" keyboard from the phone layouts for now. Change-Id: I4b18279dafb18ba7cebacfad1b7167e34a7203b4
This commit is contained in:
@@ -30,39 +30,16 @@
|
|||||||
>
|
>
|
||||||
<include layout="@layout/crypt_keeper_status" />
|
<include layout="@layout/crypt_keeper_status" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- right side: password -->
|
<EditText android:id="@+id/passwordEntry"
|
||||||
<LinearLayout
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:singleLine="true"
|
||||||
android:orientation="vertical"
|
android:textStyle="normal"
|
||||||
android:gravity="center">
|
android:inputType="textPassword"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:textColor="#ffffffff"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- Password entry field -->
|
|
||||||
<EditText android:id="@+id/passwordEntry"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="450dip"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textStyle="normal"
|
|
||||||
android:inputType="textPassword"
|
|
||||||
android:gravity="center"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:textSize="24sp"
|
|
||||||
android:layout_marginTop="120dip"
|
|
||||||
android:layout_marginBottom="5dip"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:textColor="#ffffffff"
|
|
||||||
android:editable="false"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
|
|
||||||
android:layout_width="450dip"
|
|
||||||
android:layout_height="230dip"
|
|
||||||
android:background="#00000000"
|
|
||||||
android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
|
|
||||||
android:visibility="visible"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@@ -54,11 +54,11 @@
|
|||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/status"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dip"
|
android:layout_height="0dip"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_marginLeft="16dip"
|
android:layout_marginLeft="16dip"
|
||||||
android:text="@string/crypt_keeper_setup_description"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@@ -342,9 +342,11 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
|
|||||||
|
|
||||||
KeyboardView keyboardView = (PasswordEntryKeyboardView) findViewById(R.id.keyboard);
|
KeyboardView keyboardView = (PasswordEntryKeyboardView) findViewById(R.id.keyboard);
|
||||||
|
|
||||||
PasswordEntryKeyboardHelper keyboardHelper = new PasswordEntryKeyboardHelper(this,
|
if (keyboardView != null) {
|
||||||
keyboardView, mPasswordEntry, false);
|
PasswordEntryKeyboardHelper keyboardHelper = new PasswordEntryKeyboardHelper(this,
|
||||||
keyboardHelper.setKeyboardMode(PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA);
|
keyboardView, mPasswordEntry, false);
|
||||||
|
keyboardHelper.setKeyboardMode(PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IMountService getMountService() {
|
private IMountService getMountService() {
|
||||||
@@ -357,7 +359,7 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
if (actionId == EditorInfo.IME_NULL) {
|
if (actionId == EditorInfo.IME_NULL || actionId == EditorInfo.IME_ACTION_DONE) {
|
||||||
// Get the password
|
// Get the password
|
||||||
String password = v.getText().toString();
|
String password = v.getText().toString();
|
||||||
|
|
||||||
|
@@ -62,6 +62,8 @@ public class CryptKeeperConfirm extends Fragment {
|
|||||||
public void run() {
|
public void run() {
|
||||||
IBinder service = ServiceManager.getService("mount");
|
IBinder service = ServiceManager.getService("mount");
|
||||||
if (service == null) {
|
if (service == null) {
|
||||||
|
Log.e("CryptKeeper", "Failed to find the mount service");
|
||||||
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user