More CryptKeeper UI work.

* Implemented failure case.
* More pixel perfect
* Remove the animation
* Display the encroid on the blank screen
* Remove the back button.
* Fix portrait mode screens

Bug: 3384231
Bug: 3394103
Bug: 3388721
Bug: 3381450
Bug: 3406278
Bug: 3351832
Change-Id: Ib763c8b577198deb45255acc767bc6d5409efc0c
This commit is contained in:
Andy Stadler
2011-01-31 19:21:37 -08:00
parent ba681faf73
commit 13d62049f7
21 changed files with 218 additions and 115 deletions

View File

@@ -1079,7 +1079,7 @@
<activity android:name=".CryptKeeper" <activity android:name=".CryptKeeper"
android:immersive="true" android:immersive="true"
android:launchMode="singleTop" android:launchMode="singleTop"
android:theme="@style/CryptKeeperTheme" android:theme="@android:style/Theme.Holo.NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden"> android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter android:priority="10"> <intent-filter android:priority="10">
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

View File

@@ -16,57 +16,67 @@
** limitations under the License. ** limitations under the License.
*/ */
--> -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
> >
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="0dip" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_centerHorizontal="true"
android:layout_marginTop="206dip"
> >
<!-- left side: status --> <ImageView android:id="@+id/encroid"
<include layout="@layout/crypt_keeper_status"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="102dip" android:layout_alignParentTop="true"
android:layout_marginTop="20dip" android:src="@drawable/encroid_resignin"
android:gravity="left" />
android:paddingTop="50dip"
android:layout_centerVertical="true" <TextView android:id="@+id/passwordLabel"
android:layout_alignParentLeft="true" android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_toRightOf="@+id/encroid"
android:layout_marginTop="37dip"
android:paddingRight="17dip"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/crypt_keeper_enter_password"
/> />
<!-- Password entry field --> <!-- Password entry field -->
<EditText android:id="@+id/passwordEntry" <EditText android:id="@+id/passwordEntry"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="450dip" android:layout_width="320dip"
android:layout_marginRight="155dip" android:layout_toRightOf="@+id/passwordLabel"
android:layout_alignParentRight="true" android:layout_marginTop="26dip"
android:singleLine="true" android:singleLine="true"
android:textStyle="normal"
android:inputType="textPassword" 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:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffffff"
android:editable="false" android:editable="false"
/> />
<TextView android:id="@+id/status"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_toRightOf="@+id/passwordLabel"
android:layout_below="@+id/passwordEntry"
android:paddingTop="8dip"
android:singleLine="true"
android:textSize="17sp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:drawableLeft="@*android:drawable/ic_lock_idle_lock"
android:visibility="gone"
/>
</RelativeLayout> </RelativeLayout>
<com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard" <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#00000000" android:background="#00000000"
android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans" android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
android:visibility="visible" android:visibility="visible"
/> />
</LinearLayout> </RelativeLayout>

View File

@@ -16,42 +16,59 @@
** limitations under the License. ** limitations under the License.
*/ */
--> -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_horizontal"
> >
<RelativeLayout
<!-- left side: status -->
<include layout="@layout/crypt_keeper_status"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="134dip"
android:paddingTop="50dip"
android:layout_alignParentTop="true"
android:layout_gravity="center_horizontal"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
/> android:layout_marginTop="318dip"
>
<ImageView android:id="@+id/encroid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:src="@drawable/encroid_resignin"
/>
<!-- Password entry field --> <TextView android:id="@+id/passwordLabel"
<EditText android:id="@+id/passwordEntry" android:layout_height="wrap_content"
android:layout_above="@id/keyboard" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_toRightOf="@+id/encroid"
android:layout_width="450dip" android:layout_marginTop="37dip"
android:singleLine="true" android:paddingRight="17dip"
android:textStyle="normal" android:singleLine="true"
android:inputType="textPassword" android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center" android:text="@string/crypt_keeper_enter_password"
android:layout_gravity="center_horizontal" />
android:layout_centerHorizontal="true"
android:textSize="24sp" <!-- Password entry field -->
android:layout_marginTop="120dip" <EditText android:id="@+id/passwordEntry"
android:layout_marginBottom="5dip" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium" android:layout_width="320dip"
android:textColor="#ffffffff" android:layout_toRightOf="@+id/passwordLabel"
android:editable="false" android:layout_marginTop="26dip"
/> android:singleLine="true"
android:inputType="textPassword"
android:textAppearance="?android:attr/textAppearanceMedium"
android:editable="false"
/>
<TextView android:id="@+id/status"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_toRightOf="@+id/passwordLabel"
android:layout_below="@+id/passwordEntry"
android:paddingTop="8dip"
android:singleLine="true"
android:textSize="17sp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:drawableLeft="@*android:drawable/ic_lock_idle_lock"
android:visibility="gone"
/>
</RelativeLayout>
<com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard" <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -14,24 +14,33 @@
limitations under the License. limitations under the License.
--> -->
<LinearLayout <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingTop="154dip" android:paddingTop="154dip"
android:paddingLeft="128dip" android:paddingLeft="128dip"
android:paddingRight="128dip" android:paddingRight="128dip"
android:paddingBottom="0dip" android:paddingBottom="16dip"
android:orientation="vertical"
android:background="@drawable/encryption_bg_waiting"
> >
<ImageView
android:id="@+id/encroid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:paddingRight="65dip"
android:src="@drawable/encroid_waiting"
/>
<TextView <TextView
android:id="@+id/title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="48dip" android:minHeight="48dip"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="16dip" android:layout_marginLeft="16dip"
android:textSize="30dip" android:textSize="30dip"
android:textColor="#ff99cc00" android:textColor="#ff99cc00"
@@ -44,6 +53,7 @@
android:id="@+id/top_divider" android:id="@+id/top_divider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/title"
> >
<ProgressBar <ProgressBar
android:id="@+id/progress_bar" android:id="@+id/progress_bar"
@@ -52,17 +62,41 @@
style="?android:attr/progressBarStyleHorizontal" style="?android:attr/progressBarStyleHorizontal"
/> />
</RelativeLayout> </RelativeLayout>
<TextView <TextView
android:id="@+id/status" android:id="@+id/status"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dip" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_below="@+id/top_divider"
android:paddingLeft="152dip" android:paddingLeft="152dip"
android:paddingTop="21dip" android:paddingTop="21dip"
android:textSize="18dip" android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffffff"
android:text="@string/crypt_keeper_setup_description"
/> />
</LinearLayout> <!-- Divider -->
<RelativeLayout
android:id="@+id/bottom_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="152dip"
android:layout_above="@+id/factory_reset"
android:visibility="gone"
>
<ProgressBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleHorizontal"
/>
</RelativeLayout>
<Button
android:id="@+id/factory_reset"
android:layout_width="208dip"
android:layout_height="48dip"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="80dip"
android:text="@string/master_clear_button_text"
android:visibility="gone"
/>
</RelativeLayout>

View File

@@ -5,29 +5,28 @@
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<set xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
android:interpolator="@android:anim/accelerate_interpolator" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_vertical"
> >
<scale <ImageView
android:fromXScale="1.0" android:layout_width="wrap_content"
android:toXScale="0.0" android:layout_height="wrap_content"
android:fromYScale="1.0" android:layout_gravity="center"
android:toYScale="0.0" android:src="@drawable/encroid_progress"
android:pivotX="50%"
android:pivotY="50%"
android:fillAfter="false"
android:duration="500"
/> />
</set> </LinearLayout>

View File

@@ -111,7 +111,6 @@
<!-- Title for a notification shown. --> <!-- Title for a notification shown. -->
<string name="sdcard_setting" product="default">SD card</string> <string name="sdcard_setting" product="default">SD card</string>
<!-- Battery Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed --> <!-- Battery Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
<string name="battery_info_status_label">Battery status:</string> <string name="battery_info_status_label">Battery status:</string>
<!-- Battery Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed --> <!-- Battery Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
@@ -141,7 +140,6 @@
<!-- Battery Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed --> <!-- Battery Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
<string name="battery_info_screen_on">Screen ON time:</string> <string name="battery_info_screen_on">Screen ON time:</string>
<!-- Battery Info screen. Value for a status item. Used for diagnostic info screens, precise translation isn't needed --> <!-- Battery Info screen. Value for a status item. Used for diagnostic info screens, precise translation isn't needed -->
<string name="battery_info_status_unknown">Unknown</string> <string name="battery_info_status_unknown">Unknown</string>
<!-- Battery Info screen. Value for a status item. Used for diagnostic info screens, precise translation isn't needed --> <!-- Battery Info screen. Value for a status item. Used for diagnostic info screens, precise translation isn't needed -->
@@ -493,7 +491,6 @@
<!-- Main Settings screen settings summary text for the "Wireless controls" setting --> <!-- Main Settings screen settings summary text for the "Wireless controls" setting -->
<string name="radio_controls_summary">Manage Wi-Fi, Bluetooth, airplane mode, mobile networks, &amp; VPNs</string> <string name="radio_controls_summary">Manage Wi-Fi, Bluetooth, airplane mode, mobile networks, &amp; VPNs</string>
<!-- mobile network settings screen, setting check box title --> <!-- mobile network settings screen, setting check box title -->
<string name="roaming">Data roaming</string> <string name="roaming">Data roaming</string>
<!-- mobile network settings screen, setting option summary text when check box is selected --> <!-- mobile network settings screen, setting option summary text when check box is selected -->
@@ -619,7 +616,7 @@
an hour or more. You must start with a charged battery and keep your phone plugged in an hour or more. You must start with a charged battery and keep your phone plugged in
until encryption is complete. If you interrupt the encryption process, you will lose until encryption is complete. If you interrupt the encryption process, you will lose
some or all of your data.</string> some or all of your data.</string>
<!-- Button text to start encryption process --> <!-- Button text to start encryption process -->
<string name="crypt_keeper_button_text" product="tablet">Encrypt tablet</string> <string name="crypt_keeper_button_text" product="tablet">Encrypt tablet</string>
<!-- Button text to start encryption process --> <!-- Button text to start encryption process -->
@@ -659,9 +656,29 @@
<string name="crypt_keeper_setup_description" product="default">Please wait while your phone <string name="crypt_keeper_setup_description" product="default">Please wait while your phone
is being encrypted. ^1% complete.</string> is being encrypted. ^1% complete.</string>
<!-- Informational text on the progress screen when encrypting the device has a problem --> <!-- Informational text on the password entry screen when password entry fails-->
<string name="crypt_keeper_cooldown">Try again in ^1 seconds.</string> <string name="crypt_keeper_cooldown">Try again in ^1 seconds.</string>
<!-- Informational text on the password entry screen prompting the user for their password -->
<string name="crypt_keeper_enter_password">Enter your password</string>
<!-- Title of the encryption screen when encrypting the device failed -->
<string name="crypt_keeper_failed_title">Encryption failed</string>
<!-- Informational text when encryption fails -->
<string name="crypt_keeper_failed_summary" product="tablet">
Encryption was interrupted and can\'t complete. You must perform a factory data reset (erasing
all your data) before you can resume using your tablet. You can try encrypting your tablet
again after the reset is complete.
</string>
<!-- Informational text when encryption fails -->
<string name="crypt_keeper_failed_summary" product="default">
Encryption was interrupted and can\'t complete. You must perform a factory data reset (erasing
all your data) before you can resume using your phone. You can try encrypting your phone
again after the reset is complete.
</string>
<!-- Unlock Picker Settings --><skip /> <!-- Unlock Picker Settings --><skip />
<!-- Security Picker --><skip /> <!-- Security Picker --><skip />
@@ -1160,7 +1177,6 @@
<!-- Default access point SSID used for tethering --> <!-- Default access point SSID used for tethering -->
<string name="wifi_tether_configure_ssid_default">AndroidHotspot</string> <string name="wifi_tether_configure_ssid_default">AndroidHotspot</string>
<!-- Do not translate. Used for diagnostic screens, precise translation is not necessary <!-- Do not translate. Used for diagnostic screens, precise translation is not necessary
Wi-Fi Testing on the diagnostic screen--> Wi-Fi Testing on the diagnostic screen-->
<string name="testing_wifi_info" translatable="false">Wifi information</string> <string name="testing_wifi_info" translatable="false">Wifi information</string>

View File

@@ -121,18 +121,10 @@
<item name="android:windowIsFloating">true</item> <item name="android:windowIsFloating">true</item>
</style> </style>
<style name="CryptKeeperTheme" parent="@android:style/Theme.Holo.NoActionBar">
<item name="android:windowAnimationStyle">@style/CryptKeeperAnimation</item>
</style>
<style name="CryptKeeperBlankTheme" parent="@android:style/Theme.Holo.NoActionBar"> <style name="CryptKeeperBlankTheme" parent="@android:style/Theme.Holo.NoActionBar">
<item name="android:background">#ff000000</item> <item name="android:background">#ff000000</item>
</style> </style>
<style name="CryptKeeperAnimation">
<item name="android:windowExitAnimation">@anim/crypt_keeper_exit</item>
</style>
<style name="SecurityPreferenceButtonContainer" parent="@android:style/Holo.SegmentedButton"> <style name="SecurityPreferenceButtonContainer" parent="@android:style/Holo.SegmentedButton">
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>

View File

@@ -35,16 +35,16 @@ import android.os.ServiceManager;
import android.os.SystemProperties; import android.os.SystemProperties;
import android.os.storage.IMountService; import android.os.storage.IMountService;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.format.DateFormat;
import android.util.Log; import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView; import android.widget.TextView;
import java.util.Date;
public class CryptKeeper extends Activity implements TextView.OnEditorActionListener { public class CryptKeeper extends Activity implements TextView.OnEditorActionListener {
private static final String TAG = "CryptKeeper"; private static final String TAG = "CryptKeeper";
@@ -59,6 +59,11 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
// This activity is used to fade the screen to black after the password is entered. // This activity is used to fade the screen to black after the password is entered.
public static class Blank extends Activity { public static class Blank extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.crypt_keeper_blank);
}
} }
private Handler mHandler = new Handler() { private Handler mHandler = new Handler() {
@@ -105,9 +110,12 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
// Disable the status bar // Disable the status bar
StatusBarManager sbm = (StatusBarManager) getSystemService(Context.STATUS_BAR_SERVICE); StatusBarManager sbm = (StatusBarManager) getSystemService(Context.STATUS_BAR_SERVICE);
sbm.disable(StatusBarManager.DISABLE_EXPAND | StatusBarManager.DISABLE_NOTIFICATION_ICONS sbm.disable(StatusBarManager.DISABLE_EXPAND
| StatusBarManager.DISABLE_NOTIFICATION_ICONS
| StatusBarManager.DISABLE_NOTIFICATION_ALERTS | StatusBarManager.DISABLE_NOTIFICATION_ALERTS
| StatusBarManager.DISABLE_SYSTEM_INFO | StatusBarManager.DISABLE_NAVIGATION); | StatusBarManager.DISABLE_SYSTEM_INFO
| StatusBarManager.DISABLE_NAVIGATION
| StatusBarManager.DISABLE_BACK);
} }
@Override @Override
@@ -139,9 +147,38 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
updateProgress(); updateProgress();
} }
private void showFactoryReset() {
// Hide the encryption-bot to make room for the "factory reset" button
findViewById(R.id.encroid).setVisibility(View.GONE);
// Show the reset button, failure text, and a divider
Button button = (Button) findViewById(R.id.factory_reset);
button.setVisibility(View.VISIBLE);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// Factory reset the device.
sendBroadcast(new Intent("android.intent.action.MASTER_CLEAR"));
}
});
TextView tv = (TextView) findViewById(R.id.title);
tv.setText(R.string.crypt_keeper_failed_title);
tv = (TextView) findViewById(R.id.status);
tv.setText(R.string.crypt_keeper_failed_summary);
View view = findViewById(R.id.bottom_divider);
view.setVisibility(View.VISIBLE);
}
private void updateProgress() { private void updateProgress() {
String state = SystemProperties.get("vold.encrypt_progress"); String state = SystemProperties.get("vold.encrypt_progress");
if ("error_partially_encrypted".equals(state)) {
showFactoryReset();
return;
}
int progress = 0; int progress = 0;
try { try {
progress = Integer.parseInt(state); progress = Integer.parseInt(state);
@@ -160,16 +197,18 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
private void cooldown() { private void cooldown() {
TextView tv = (TextView) findViewById(R.id.status); TextView tv = (TextView) findViewById(R.id.status);
if (mCooldown <= 0) { if (mCooldown <= 0) {
// Re-enable the password entry // Re-enable the password entry
EditText passwordEntry = (EditText) findViewById(R.id.passwordEntry); EditText passwordEntry = (EditText) findViewById(R.id.passwordEntry);
passwordEntry.setEnabled(true); passwordEntry.setEnabled(true);
tv.setText(R.string.try_again); tv.setVisibility(View.GONE);
} else { } else {
CharSequence tempalte = getText(R.string.crypt_keeper_cooldown); CharSequence template = getText(R.string.crypt_keeper_cooldown);
tv.setText(TextUtils.expandTemplate(tempalte, Integer.toString(mCooldown))); tv.setText(TextUtils.expandTemplate(template, Integer.toString(mCooldown)));
tv.setVisibility(View.VISIBLE);
mCooldown--; mCooldown--;
mHandler.removeMessages(COOLDOWN); mHandler.removeMessages(COOLDOWN);
@@ -186,14 +225,6 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
PasswordEntryKeyboardHelper keyboardHelper = new PasswordEntryKeyboardHelper(this, PasswordEntryKeyboardHelper keyboardHelper = new PasswordEntryKeyboardHelper(this,
keyboardView, passwordEntry, false); keyboardView, passwordEntry, false);
keyboardHelper.setKeyboardMode(PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA); keyboardHelper.setKeyboardMode(PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA);
passwordEntry.setCompoundDrawablesWithIntrinsicBounds(android.R.drawable.ic_lock_idle_lock,
0, 0, 0);
String dateFormatString = getString(com.android.internal.R.string.full_wday_month_day_no_year);
TextView date = (TextView) findViewById(R.id.date);
date.setText(DateFormat.format(dateFormatString, new Date()));
} }
private IMountService getMountService() { private IMountService getMountService() {
@@ -240,6 +271,7 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
} else { } else {
TextView tv = (TextView) findViewById(R.id.status); TextView tv = (TextView) findViewById(R.id.status);
tv.setText(R.string.try_again); tv.setText(R.string.try_again);
tv.setVisibility(View.VISIBLE);
} }
} catch (Exception e) { } catch (Exception e) {
Log.e(TAG, "Error while decrypting...", e); Log.e(TAG, "Error while decrypting...", e);

View File

@@ -41,6 +41,8 @@ public class CryptKeeperConfirm extends Fragment {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.crypt_keeper_blank);
if (Utils.isMonkeyRunning()) { if (Utils.isMonkeyRunning()) {
finish(); finish();
} }
@@ -50,7 +52,8 @@ public class CryptKeeperConfirm extends Fragment {
| StatusBarManager.DISABLE_NOTIFICATION_ICONS | StatusBarManager.DISABLE_NOTIFICATION_ICONS
| StatusBarManager.DISABLE_NOTIFICATION_ALERTS | StatusBarManager.DISABLE_NOTIFICATION_ALERTS
| StatusBarManager.DISABLE_SYSTEM_INFO | StatusBarManager.DISABLE_SYSTEM_INFO
| StatusBarManager.DISABLE_NAVIGATION); | StatusBarManager.DISABLE_NAVIGATION
| StatusBarManager.DISABLE_BACK);
// Post a delayed message in 700 milliseconds to enable encryption. // Post a delayed message in 700 milliseconds to enable encryption.
// NOTE: The animation on this activity is set for 500 milliseconds // NOTE: The animation on this activity is set for 500 milliseconds