Adding broadcast receiver to handle SESSION_COMMIT broadcast

> Disabling Install shortcut broadcast for O and above
> Adding a preference to control automatic icon addition on homescreen
> Adding icons on homescreen for new installs based on the above preference

Bug: 32920609
Bug: 27967412
Change-Id: I92e5cb7c841fb445dc8bc058d975f212ee54f8d1
diff --git a/AndroidManifest-common.xml b/AndroidManifest-common.xml
index da1679f..50fb2d7 100644
--- a/AndroidManifest-common.xml
+++ b/AndroidManifest-common.xml
@@ -58,12 +58,21 @@
         <!-- Intent received used to install shortcuts from other applications -->
         <receiver
             android:name="com.android.launcher3.InstallShortcutReceiver"
-            android:permission="com.android.launcher.permission.INSTALL_SHORTCUT">
+            android:permission="com.android.launcher.permission.INSTALL_SHORTCUT"
+            android:enabled="@bool/enable_install_shortcut_api" >
             <intent-filter>
                 <action android:name="com.android.launcher.action.INSTALL_SHORTCUT" />
             </intent-filter>
         </receiver>
 
+        <!-- Intent received when a session is committed -->
+        <receiver
+            android:name="com.android.launcher3.SessionCommitReceiver" >
+            <intent-filter>
+                <action android:name="android.content.pm.action.SESSION_COMMITTED" />
+            </intent-filter>
+        </receiver>
+
         <!-- Intent received used to initialize a restored widget -->
         <receiver android:name="com.android.launcher3.AppWidgetsRestoredReceiver" >
             <intent-filter>