[android-developers] Re: Mimic Home button in software

2010-06-20 Thread GodsMoon
Oh. That is important information! My app, Smart Lock, manipulates the
Keyguard a lot. That's the main feature actually.
To clarify, who is a device admin?

On Jun 20, 12:22 am, Dianne Hackborn hack...@android.com wrote:
 Ah.  Replacing the lock screen and such is not at this point supported.  You
 may figure out a hack to do what you want, but we can't guarantee it will
 work on future versions of the platform or even across devices.

 The disableKeyguard method was original introduced for very specific
 situations such as showing the in-call screen while the device is locked.
  It has a lot of problems, and is becoming deprecated -- we have been
 introducing new window flags that provide a much better way to interact with
 the lock screen for the uses that disableKeyguard was originally done for.
  Also you will start to find that the method doesn't work in some
 situations.  For example starting in Froyo it will not work when a device
 admin is requiring the user have a lock screen, since disabling
 uncontrollably (not using one of the newer window flags) would conflict with
 the security the admin is enforcing.





 On Sat, Jun 19, 2010 at 6:10 PM, GodsMoon godsm...@gmail.com wrote:
  Sorry, my app disables the keyguard with disableKeyguard().
  This makes inKeyguardRestrictedInputMode() return true so clicking on
  the home button brings up the lock screen (the special one without the
  Emergency Call button).
  I would like to see this lock screen when pressing the back button.

  Actually, I just want to know how to bring up that special lock screen
  on demand. I know it comes up with the home button so I was going to
  try to mimic that.

  Thanks for your help,
  David Shellabarger

  On Jun 19, 5:40 pm, Dianne Hackborn hack...@android.com wrote:
   I'm not sure I understand...  if you want to switch to home from your app
   (which I am pretty sure the intent you give below is the right way), what
   would this have to do with the keyguard?  If the user is in your app,
  they
   aren't in the keyguard...  I don't understand the connection you have
   between the two.

   On Sat, Jun 19, 2010 at 11:03 AM, GodsMoon godsm...@gmail.com wrote:
I would like the back button to work exactly like the home button in
my activity. I know that doesn't sounds like something I would want to
do, but it makes sense in the context of my app.

I've tried an intent:
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_HOME);
startActivity(intent);
But this doesn't work the same way.
I've tried super.onKeyDown(KeyEvent.KEYCODE_HOME, event); on the
onKeyDown method and it does nothing.

They problem is the keyguard acts different when you push the home
button when you have an unlock pattern set.
There is usually a Emergency Call button on the unlock pattern
screen, but there is not when you click the home button and you have
dismissed the keyguard.
I would like the back button to behave the same way.

Would I be able to do this with the instrument class? Is there a
better way to do it?

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
  android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs
 cr...@googlegroups.comandroid-developers%2Bunsubs
  cr...@googlegroups.com
For more options, visit this group at
   http://groups.google.com/group/android-developers?hl=en

   --
   Dianne Hackborn
   Android framework engineer
   hack...@android.com

   Note: please don't send private questions to me, as I don't have time to
   provide private support, and so won't reply to such e-mails.  All such
   questions should be posted on public forums, where I and others can see
  and
   answer them.

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs 
  cr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more 

Re: [android-developers] Re: Mimic Home button in software

2010-06-20 Thread Mark Murphy
On Sun, Jun 20, 2010 at 11:57 AM, GodsMoon godsm...@gmail.com wrote:
 Oh. That is important information! My app, Smart Lock, manipulates the
 Keyguard a lot. That's the main feature actually.
 To clarify, who is a device admin?

New device policy management APIs allow developers to write 'device
administrator' applications that can control security features of the
device, such as the minimum password strength, data wipe, and so on.
Users can select the administrators that are enabled on their
devices.

http://developer.android.com/reference/android/app/admin/package-summary.html
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.html

That's all that is written about it at this time, that I have been able to find.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.1
Available!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Mimic Home button in software

2010-06-20 Thread Dianne Hackborn
There should be a blog post at some point; this is used to implement the new
corp exchange support for example.  So if you are using an exchange server
that requires a lock pattern, the old API to hide the lock screen will not
work.

On Sun, Jun 20, 2010 at 9:04 AM, Mark Murphy mmur...@commonsware.comwrote:

 On Sun, Jun 20, 2010 at 11:57 AM, GodsMoon godsm...@gmail.com wrote:
  Oh. That is important information! My app, Smart Lock, manipulates the
  Keyguard a lot. That's the main feature actually.
  To clarify, who is a device admin?

 New device policy management APIs allow developers to write 'device
 administrator' applications that can control security features of the
 device, such as the minimum password strength, data wipe, and so on.
 Users can select the administrators that are enabled on their
 devices.


 http://developer.android.com/reference/android/app/admin/package-summary.html

 http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.html

 That's all that is written about it at this time, that I have been able to
 find.

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 _The Busy Coder's Guide to Android Development_ Version 3.1
 Available!

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Mimic Home button in software

2010-06-19 Thread GodsMoon
Sorry, my app disables the keyguard with disableKeyguard().
This makes inKeyguardRestrictedInputMode() return true so clicking on
the home button brings up the lock screen (the special one without the
Emergency Call button).
I would like to see this lock screen when pressing the back button.

Actually, I just want to know how to bring up that special lock screen
on demand. I know it comes up with the home button so I was going to
try to mimic that.

Thanks for your help,
David Shellabarger


On Jun 19, 5:40 pm, Dianne Hackborn hack...@android.com wrote:
 I'm not sure I understand...  if you want to switch to home from your app
 (which I am pretty sure the intent you give below is the right way), what
 would this have to do with the keyguard?  If the user is in your app, they
 aren't in the keyguard...  I don't understand the connection you have
 between the two.





 On Sat, Jun 19, 2010 at 11:03 AM, GodsMoon godsm...@gmail.com wrote:
  I would like the back button to work exactly like the home button in
  my activity. I know that doesn't sounds like something I would want to
  do, but it makes sense in the context of my app.

  I've tried an intent:
  Intent intent = new Intent(Intent.ACTION_MAIN, null);
  intent.addCategory(Intent.CATEGORY_HOME);
  startActivity(intent);
  But this doesn't work the same way.
  I've tried super.onKeyDown(KeyEvent.KEYCODE_HOME, event); on the
  onKeyDown method and it does nothing.

  They problem is the keyguard acts different when you push the home
  button when you have an unlock pattern set.
  There is usually a Emergency Call button on the unlock pattern
  screen, but there is not when you click the home button and you have
  dismissed the keyguard.
  I would like the back button to behave the same way.

  Would I be able to do this with the instrument class? Is there a
  better way to do it?

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs 
  cr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Mimic Home button in software

2010-06-19 Thread GodsMoon
special lockscreen looks like this btw
http://nightshadelabs.appspot.com/static/lockscreen.png

On Jun 19, 9:10 pm, GodsMoon godsm...@gmail.com wrote:
 Sorry, my app disables the keyguard with disableKeyguard().
 This makes inKeyguardRestrictedInputMode() return true so clicking on
 the home button brings up the lock screen (the special one without the
 Emergency Call button).
 I would like to see this lock screen when pressing the back button.

 Actually, I just want to know how to bring up that special lock screen
 on demand. I know it comes up with the home button so I was going to
 try to mimic that.

 Thanks for your help,
 David Shellabarger

 On Jun 19, 5:40 pm, Dianne Hackborn hack...@android.com wrote:



  I'm not sure I understand...  if you want to switch to home from your app
  (which I am pretty sure the intent you give below is the right way), what
  would this have to do with the keyguard?  If the user is in your app, they
  aren't in the keyguard...  I don't understand the connection you have
  between the two.

  On Sat, Jun 19, 2010 at 11:03 AM, GodsMoon godsm...@gmail.com wrote:
   I would like the back button to work exactly like the home button in
   my activity. I know that doesn't sounds like something I would want to
   do, but it makes sense in the context of my app.

   I've tried an intent:
   Intent intent = new Intent(Intent.ACTION_MAIN, null);
   intent.addCategory(Intent.CATEGORY_HOME);
   startActivity(intent);
   But this doesn't work the same way.
   I've tried super.onKeyDown(KeyEvent.KEYCODE_HOME, event); on the
   onKeyDown method and it does nothing.

   They problem is the keyguard acts different when you push the home
   button when you have an unlock pattern set.
   There is usually a Emergency Call button on the unlock pattern
   screen, but there is not when you click the home button and you have
   dismissed the keyguard.
   I would like the back button to behave the same way.

   Would I be able to do this with the instrument class? Is there a
   better way to do it?

   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs
cr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en

  --
  Dianne Hackborn
  Android framework engineer
  hack...@android.com

  Note: please don't send private questions to me, as I don't have time to
  provide private support, and so won't reply to such e-mails.  All such
  questions should be posted on public forums, where I and others can see and
  answer them.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Mimic Home button in software

2010-06-19 Thread Dianne Hackborn
Ah.  Replacing the lock screen and such is not at this point supported.  You
may figure out a hack to do what you want, but we can't guarantee it will
work on future versions of the platform or even across devices.

The disableKeyguard method was original introduced for very specific
situations such as showing the in-call screen while the device is locked.
 It has a lot of problems, and is becoming deprecated -- we have been
introducing new window flags that provide a much better way to interact with
the lock screen for the uses that disableKeyguard was originally done for.
 Also you will start to find that the method doesn't work in some
situations.  For example starting in Froyo it will not work when a device
admin is requiring the user have a lock screen, since disabling
uncontrollably (not using one of the newer window flags) would conflict with
the security the admin is enforcing.

On Sat, Jun 19, 2010 at 6:10 PM, GodsMoon godsm...@gmail.com wrote:

 Sorry, my app disables the keyguard with disableKeyguard().
 This makes inKeyguardRestrictedInputMode() return true so clicking on
 the home button brings up the lock screen (the special one without the
 Emergency Call button).
 I would like to see this lock screen when pressing the back button.

 Actually, I just want to know how to bring up that special lock screen
 on demand. I know it comes up with the home button so I was going to
 try to mimic that.

 Thanks for your help,
 David Shellabarger


 On Jun 19, 5:40 pm, Dianne Hackborn hack...@android.com wrote:
  I'm not sure I understand...  if you want to switch to home from your app
  (which I am pretty sure the intent you give below is the right way), what
  would this have to do with the keyguard?  If the user is in your app,
 they
  aren't in the keyguard...  I don't understand the connection you have
  between the two.
 
 
 
 
 
  On Sat, Jun 19, 2010 at 11:03 AM, GodsMoon godsm...@gmail.com wrote:
   I would like the back button to work exactly like the home button in
   my activity. I know that doesn't sounds like something I would want to
   do, but it makes sense in the context of my app.
 
   I've tried an intent:
   Intent intent = new Intent(Intent.ACTION_MAIN, null);
   intent.addCategory(Intent.CATEGORY_HOME);
   startActivity(intent);
   But this doesn't work the same way.
   I've tried super.onKeyDown(KeyEvent.KEYCODE_HOME, event); on the
   onKeyDown method and it does nothing.
 
   They problem is the keyguard acts different when you push the home
   button when you have an unlock pattern set.
   There is usually a Emergency Call button on the unlock pattern
   screen, but there is not when you click the home button and you have
   dismissed the keyguard.
   I would like the back button to behave the same way.
 
   Would I be able to do this with the instrument class? Is there a
   better way to do it?
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.comandroid-developers%2Bunsubs
 cr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en
 
  --
  Dianne Hackborn
  Android framework engineer
  hack...@android.com
 
  Note: please don't send private questions to me, as I don't have time to
  provide private support, and so won't reply to such e-mails.  All such
  questions should be posted on public forums, where I and others can see
 and
  answer them.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en