2016年setiings项目: 服务端:
frameworks/base/core/java/com/android/internal/widget/ILockSettings.aidl
setSecurityPassword(String pwd)
getSecurityPassword()
frameworks/base/services/core/java/com/android/server/locksettings/LockSettingsService.java
public class LockSettingsService extends ILockSettings.Stub
201
202
203
204 public static final class Lifecycle extends SystemService {
205 private LockSettingsService mLockSettingsService;
206
207 public Lifecycle(Context context) {
208 super(context);
209 }
210
211 @Override
212 public void onStart() {
213 AndroidKeyStoreProvider.install();
214 mLockSettingsService = new LockSettingsService(getContext());
215 publishBinderService("lock_settings", mLockSettingsService);
216 }
217
setSecurityPassword(String pwd)
getSecurityPassword()
frameworks/base/services/core/java/com/android/server/SystemService.java
234 protected final void publishBinderService(String name, IBinder service,
235 boolean allowIsolated, int dumpPriority) {
236 ServiceManager.addService(name, service, allowIsolated, dumpPriority);
237 }
客户端: frameworks/base/core/java/com/android/internal/widget/LockPatternUtils.java
266 public ILockSettings getLockSettings() {
267 if (mLockSettingsService == null) {
268 ILockSettings service = ILockSettings.Stub.asInterface(
269 ServiceManager.getService("lock_settings"));
270 mLockSettingsService = service;
271 }
272 return mLockSettingsService;
273 }
274
572 * get lock password.
573 * @return pwd.
574 */
575 public String getSecurityPasswords() {
576 try {
577 return getLockSettings().getSecurityPassword();
578 } catch (RemoteException re) {
Log.w(TAG,"getSecurityPasswords: "+re.getMessage());
579 return "";
580 }
581 }
582
572 * set lock password.
573 * @p pwd.
574 */
575 public void setSecurityPassword(String pwd) {
576 try {
577 getLockSettings().setSecurityPassword(String pwd);
578 } catch (RemoteException re) {
579 Log.w(TAG,"setSecurityPassword: "+re.getMessage());
580 }
581 }
582
|