Make the system locale available to the decryption UI.
Bug: 17659622 Change-Id: I8f7d1c4d1d04ec483b6a3c9bea742f79374b647a
This commit is contained in:
@@ -35,8 +35,12 @@ import android.widget.Button;
|
|||||||
|
|
||||||
import com.android.internal.widget.LockPatternUtils;
|
import com.android.internal.widget.LockPatternUtils;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
public class CryptKeeperConfirm extends Fragment {
|
public class CryptKeeperConfirm extends Fragment {
|
||||||
|
|
||||||
|
private static final String TAG = "CryptKeeperConfirm";
|
||||||
|
|
||||||
public static class Blank extends Activity {
|
public static class Blank extends Activity {
|
||||||
private Handler mHandler = new Handler();
|
private Handler mHandler = new Handler();
|
||||||
|
|
||||||
@@ -107,17 +111,26 @@ public class CryptKeeperConfirm extends Fragment {
|
|||||||
is then persisted, and the settings will be there on future
|
is then persisted, and the settings will be there on future
|
||||||
reboots.
|
reboots.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// 1. The owner info.
|
||||||
LockPatternUtils utils = new LockPatternUtils(getActivity());
|
LockPatternUtils utils = new LockPatternUtils(getActivity());
|
||||||
utils.setVisiblePatternEnabled(utils.isVisiblePatternEnabled());
|
utils.setVisiblePatternEnabled(utils.isVisiblePatternEnabled());
|
||||||
if (utils.isOwnerInfoEnabled()) {
|
if (utils.isOwnerInfoEnabled()) {
|
||||||
utils.setOwnerInfo(utils.getOwnerInfo(UserHandle.USER_OWNER),
|
utils.setOwnerInfo(utils.getOwnerInfo(UserHandle.USER_OWNER),
|
||||||
UserHandle.USER_OWNER);
|
UserHandle.USER_OWNER);
|
||||||
}
|
}
|
||||||
|
|
||||||
Intent intent = new Intent(getActivity(), Blank.class);
|
Intent intent = new Intent(getActivity(), Blank.class);
|
||||||
intent.putExtras(getArguments());
|
intent.putExtras(getArguments());
|
||||||
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
||||||
|
// 2. The system locale.
|
||||||
|
try {
|
||||||
|
IBinder service = ServiceManager.getService("mount");
|
||||||
|
IMountService mountService = IMountService.Stub.asInterface(service);
|
||||||
|
mountService.setField("SystemLocale", Locale.getDefault().toLanguageTag());
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "Error storing locale for decryption UI", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user