22

I've got an application that has two search suggestion providers that both extend SearchRecentSuggestionsProvider, and I've set it up correctly in the manifest file with the following Intent filter and meta-data:

<intent-filter>
   <action android:name="android.intent.action.SEARCH" />
</intent-filter>

<meta-data
   android:name="android.app.searchable"
   android:resource="@xml/searchable_tv" />

The searcable resource includes android:includeInGlobalSearch="true", so that should be fine.

And I've obviously got a provider there as well:

<provider
   android:name="com.miz.contentprovider.TvShowContentProvider"
   android:authorities="com.miz.contentprovider.TvShowContentProvider"
   android:exported="true" />

This all worked just fine in Android 4.3 using the Google search application, but I've just updated all my devices to Android 4.4 and I am no longer able to search content within my application. Same thing goes for other applications that worked before the OS update, i.e. Google Play Music.

I've found a thread on XDA developers that mentions this as well, if it helps: http://forum.xda-developers.com/showthread.php?p=47472102

Does anyone have any idea what's happening or how it can be fixed?

Update: I can confirm that it only occurs on devices with Android 4.4. I've tested on an Android 4.3 device using the latest Google Search update, and it works as expected. Looks like it's a bug in Google's update.

Michell Bak
  • 13,182
  • 11
  • 64
  • 121
  • The Google Chrome app does show up in the list though. – nhaarman Nov 17 '13 at 21:33
  • It seems like it's only the beta version that shows up. – Michell Bak Nov 17 '13 at 23:24
  • Shows that it's not per se a bug, but it could be that they silently tightened the filters. – nhaarman Nov 18 '13 at 07:19
  • I looked through the manifest file of the latest Chrome beta app and couldn't find any differences. It doesn't make any sense that they would change the filters on 4.4, but leave it unchanged on 4.3. – Michell Bak Nov 18 '13 at 11:53
  • Could you edit your question to be more in the format of a question than a bug report? Are you looking for someone to explain how this bug is affecting search? Are you looking for a workaround to fix this in 4.4? Both? – sturrockad Nov 19 '13 at 11:31
  • Well, both. I can't call it a bug since I don't know if it's by design, although I highly doubt it. Also, I'd love to find a workaround if such exists. – Michell Bak Nov 19 '13 at 12:28
  • 3
    Link to the Issue Tracker page with the report: https://code.google.com/p/android/issues/detail?id=62251. It's not acknowledged yet by anyone on their side though. – Joe Nov 20 '13 at 18:29
  • Just added a comment linking to this thread. – Michell Bak Nov 20 '13 at 20:51

3 Answers3

8

I found this commit in AOSP, which might be related: https://android.googlesource.com/platform/packages/apps/QuickSearchBox/+/ecf356c15143ab0583c64682de16d94a57f7dd1c

The commit message tells us that this feature was removed due to performance reasons (which might or might not be true, given that it references an internal ticket id and I didn't find a related issue about this on the official bugtracker).

arne.jans
  • 3,798
  • 2
  • 22
  • 27
  • Looks like this is the answer. Sad, though. – Michell Bak Feb 07 '14 at 12:08
  • 1
    If you really are dependent on this feature, regardless of implementation, you could always install the app "QuickSearch" (id=de.jars.android.quicksearch). This app somehow emulates the Phone Search mechanism so that you can still search your apps. Drawback to this is: this app has adware and looks quite ugly on modern devices as it is themed with Android 2.x style and not optimized for tablets. – arne.jans May 15 '14 at 07:29
5

I checked with contacts at Google, and App Indexing is replacing this. The documentation will be updated to show this as deprecated, and there is no way to get this feature to work on Kit Kat without system level permissions (as iDev showed above).

Matthew Runo
  • 1,387
  • 3
  • 20
  • 43
  • 2
    I'm not saying it isn't true, but I hope it isn't. Not all applications will be able to make use of that feature and it most certainly doesn't replace global device search. – Michell Bak Jan 14 '14 at 10:57
  • I agree. It was nice to be able to expose our app on device search =\ – Matthew Runo Jan 16 '14 at 17:34
  • This answer provides a link confirming what you said, so I'm upvoting yours and accepting the other one: http://stackoverflow.com/a/21627271/762442 – Michell Bak Feb 07 '14 at 12:09
  • I wish it wasn't so, but it seems like App Indexing is the future. I'm not sure what we'd do if we didn't have a website that we can actually do app indexing on though.. – Matthew Runo Feb 10 '14 at 19:01
1

Google Chrome appears now as a searchable app since its last update (v31).

System Application:

Have try like this

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.globalsearch" android:sharedUserId="android.uid.shared">
    <uses-permission android:name="android.permission.GLOBAL_SEARCH" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.SET_PREFERRED_APPLICATIONS" />
    <application android:label="@string/global_search" android:process="android.process.acore">
        <activity android:name=".GlobalSearch" android:permission="android.permission.GLOBAL_SEARCH_CONTROL" android:stateNotNeeded="true" android:theme="@android:style/Theme.NoDisplay" android:excludeFromRecents="true">
            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <!-- This must be higher than the default priority (0), which
is what GoogleSearch uses. -->
            <intent-filter android:priority="500">
                <action android:name="android.search.action.GLOBAL_SEARCH" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <meta-data android:name="android.app.searchable" android:resource="@xml/searchable" />
        </activity>
        <activity android:name=".SearchSettings" android:label="@string/search_settings">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.search.action.SEARCH_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <provider android:name=".SuggestionProvider" android:authorities="com.android.globalsearch.SuggestionProvider" android:permission="android.permission.GLOBAL_SEARCH_CONTROL" />
        <provider android:name=".StatsProvider" android:authorities="com.android.globalsearch.stats" android:permission="android.permission.GLOBAL_SEARCH_CONTROL" />
        <meta-data android:name="android.app.default_searchable" android:value=".GlobalSearch" />
    </application>
</manifest>
yashhy
  • 2,856
  • 5
  • 31
  • 57
codercat
  • 22,873
  • 9
  • 61
  • 85
  • As far as I know, the android.permission.GLOBAL_SEARCH permission is for system applications and can't be used by 3rd party apps, so without having tried it, I'm pretty sure that won't work. – Michell Bak Nov 23 '13 at 20:41
  • @MichellBak Are you try with Android 4.4 sample SearchableDictionary. it's works for me – codercat Nov 25 '13 at 07:55
  • `android.permission.GLOBAL_SEARCH` from /frameworks/base/core/res/AndroidManifest.xml: `` so in fact this permission will not be granted. @iDev have you checked LogCat/ PackageManager.checkPermission to be sure your app is not being denied this permission? – Tom Jan 06 '14 at 23:46