From adb8f9d1325690bde6595ee15cb4105a5dad1adb Mon Sep 17 00:00:00 2001 From: Amir Zaidi Date: Sun, 19 Aug 2018 22:51:42 +0200 Subject: [PATCH] Add smartspace forwarding to Google App --- app/build.gradle | 2 +- app/src/pixel/AndroidManifest.xml | 21 +++++++++++++++++++ .../java/amirz/aidlbridge/Forwarder.java | 4 ++++ .../PixelLauncherBroadcastReceiver.java | 4 ++++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 app/src/pixel/java/amirz/aidlbridge/PixelLauncherBroadcastReceiver.java diff --git a/app/build.gradle b/app/build.gradle index 78e30ae..5a5c45d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,7 +7,7 @@ android { minSdkVersion 21 targetSdkVersion 28 versionCode 1 - versionName "1.0" + versionName "v1" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } diff --git a/app/src/pixel/AndroidManifest.xml b/app/src/pixel/AndroidManifest.xml index 874d2d2..af0f48d 100644 --- a/app/src/pixel/AndroidManifest.xml +++ b/app/src/pixel/AndroidManifest.xml @@ -2,12 +2,33 @@ + + + + + + + + + + + + + + + + diff --git a/app/src/pixel/java/amirz/aidlbridge/Forwarder.java b/app/src/pixel/java/amirz/aidlbridge/Forwarder.java index 4a07f20..6397813 100644 --- a/app/src/pixel/java/amirz/aidlbridge/Forwarder.java +++ b/app/src/pixel/java/amirz/aidlbridge/Forwarder.java @@ -5,8 +5,11 @@ import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.ResolveInfo; +import android.util.Log; public abstract class Forwarder extends BroadcastReceiver { + private static final String TAG = "Forwarder"; + @Override public void onReceive(Context context, Intent intent) { Intent i = (Intent) intent.clone(); @@ -18,6 +21,7 @@ public void onReceive(Context context, Intent intent) { if (ai != null) { String packageName = ai.packageName; if (packageName != null && !BuildConfig.APPLICATION_ID.equals(packageName)) { + Log.w(TAG, "Sending " + i.getAction() + " to " + packageName); i.setPackage(packageName); context.sendBroadcast(i); } diff --git a/app/src/pixel/java/amirz/aidlbridge/PixelLauncherBroadcastReceiver.java b/app/src/pixel/java/amirz/aidlbridge/PixelLauncherBroadcastReceiver.java new file mode 100644 index 0000000..8709da5 --- /dev/null +++ b/app/src/pixel/java/amirz/aidlbridge/PixelLauncherBroadcastReceiver.java @@ -0,0 +1,4 @@ +package amirz.aidlbridge; + +public class PixelLauncherBroadcastReceiver extends Forwarder { +}