From 41de1355ef13aa6ed7793415ee6cb40cd8386f4e Mon Sep 17 00:00:00 2001 From: zhuw Date: Fri, 2 Nov 2018 13:48:27 +0800 Subject: change Home button function in timelinepage finish activity state when Gallery is in timeline page Change-Id: I2b322430449d47d423f74143ad4e46b9dc90de80 --- src/com/android/gallery3d/app/GalleryActivity.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/com/android/gallery3d/app/GalleryActivity.java') diff --git a/src/com/android/gallery3d/app/GalleryActivity.java b/src/com/android/gallery3d/app/GalleryActivity.java index 16920b942..c4b9564d1 100755 --- a/src/com/android/gallery3d/app/GalleryActivity.java +++ b/src/com/android/gallery3d/app/GalleryActivity.java @@ -25,6 +25,7 @@ import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import android.content.Intent; +import android.content.IntentFilter; import android.content.UriMatcher; import android.content.pm.PackageManager; import android.graphics.Color; @@ -618,4 +619,20 @@ public final class GalleryActivity extends AbstractGalleryActivity implements On } return super.onGenericMotionEvent(event); } + + public void registerHomeButtonReceiver(TimeLinePage.HomeIconActionReceiver receiver) { + IntentFilter filter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); + registerReceiver(receiver, filter); + } + + public void unregisterHomeButtonReceiver(TimeLinePage.HomeIconActionReceiver receiver) { + if (receiver == null) { + return; + } + try { + unregisterReceiver(receiver); + } catch (Exception e) { + Log.w(TAG, "unregister HomeIconActionReceiver failed"); + } + } } -- cgit v1.2.3