Settings: Support showing carrier/provider logo on statusbar [2/2]

Change-Id: I3e05a71ad7bbe2c0fae8a32e78bb1e2d7ea604cb
Signed-off-by: scott <scott@ubuntu>
Settings: Make settings searchable.

Signed-off-by: Adnan Begovic <adnan@cyngn.com>
Signed-off-by: Danesh Mondegarian <danesh@cyngn.com>
Change-Id: Ic06dca33bf8fd0ef8f63f51e131b70fe730cb7c5
Signed-off-by: scott <scott@ubuntu>

Conflicts:
	AndroidManifest.xml
	res/values/attrs.xml
	res/xml/lockscreen_interface_settings.xml
	res/xml/notification_drawer.xml
	res/xml/quick_settings_panel.xml
	res/xml/settings_headers.xml
	src/com/android/settings/Settings.java
Settings: Check to see if menu items are null onPause.

Change-Id: I5463b1eab1017840ec1ec204090c9c61603377a3
Clean up search code.

Fix up coding style and add a few missing TypedArray.recycle() calls.
Also make filtering code more efficient.

Change-Id: Ie3824b41ae40010686ff3cb6cab7f12d19843834
Signed-off-by: scott <scott@ubuntu>

Conflicts:
	src/com/android/settings/Settings.java
Settings : Make search locale friendly

Change-Id: I3ae4b074af7a0ab4105f35d3ee8d6e5ef004af3d
Signed-off-by: scott <scott@ubuntu>

Conflicts:
	AndroidManifest.xml
Settings : Get actionbar post extra retrieval

Fetching the actionbar before the extras are utilized causes the parentActivityName
to be null and no home as up enabled.

Change-Id: Ic3395c4a2e0c04aee4efab5345cb604475691016
Show parent fragment name in option search.

For doing that, parent titles were missing for options placed in
fragments which are directly invoked by a settings header. Fixit.

Change-Id: Iad9340fa76eb6f2f38f4b0d7b84f2c7fa357b162
Settings : Preserve title id

Change-Id: Ieea43e5ebe955ae31190daa0db635611c4ec7f49
Settings: Don't match action bar parent for search on tablets.

Also adjust IME flags to
a) show the search icon as action key and
b) to not appear fullscreen in landscape

Change-Id: I9bc9851d39aa4d6dbed40df63dd4ea8df6f4c3f9
Settings : Scroll to preference on search and highlight

Change-Id: I93c4106d022b416205cc33cf5dbdf5d7635a002a
Highlight search string match.

Change-Id: I72c0380512028674c91f287325f221a686a4821d
Improve search performance.

The normalization regex is slow (5-10ms per entry on mako), so better
pre-cache it. Also cache the icons, as the number of icons is vastly
smaller than the number of potential search results, so they'll be
reused very often.

The regex change alone brings the duration of a single filter run down
to ~20ms from ~1200ms on mako.

Change-Id: Ia0fa9c554d0d585a52c8a2b87eecbf045388c961
Settings: Bump SettingsSearch db version.

Change-Id: I0ba3be71f61fcae9c2fe67064b5f890fdd0abb2c
Improve search UX prior to load being finished.

Show a informative hint in that case.
Also clean up code somewhat.

Change-Id: I57f37bc60fbaef2ea0db0b0c3227df125b0e4ab9
Signed-off-by: scott <scott@ubuntu>

Conflicts:
	src/com/android/settings/Settings.java
Check locale when populating DB instead of using separate receiver.

This makes reloading the search data race condition free. Previously,
when invoking search directly after the locale change, one would get the
results for the old or the new locale depending on timing between the
broadcast being delivered and the activity restart.

Change-Id: I35bc11a7f68e655e00fe53b829deea613da74f69
settings: properly count preferences in group

When the first preference in a settings preference fragment is a caterory, this method cannot
find the first preference of the group, returning an incorrect position.
xe: Lockscreen Settings -> Screen settings

Reason for that is that there's no way to differentiate 0 from -0. Fix
that by avoiding overloading integer semantics and clearly splitting the
result count from the 'was stopAt found' flag.

Change-Id: I68cfde27b9860246b1cc3671dfb35320c4ff3ea8
Apply match spans synchronously to avoid a race condition

Using the match start/end positions from both the main thread (when
updating UI) and the filter thread (when the filter constraint changed)
at the same time can lead into exceptions. Make sure to update the positions used by
the UI thread only from there.

07-11 03:26:18.845: E/AndroidRuntime(12765): Process: com.android.settings, PID: 12765
07-11 03:26:18.845: E/AndroidRuntime(12765): java.lang.IndexOutOfBoundsException: setSpan (-1 ... -1) starts before 0
07-11 03:26:18.845: E/AndroidRuntime(12765): at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1021)
07-11 03:26:18.845: E/AndroidRuntime(12765): at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:592)
07-11 03:26:18.845: E/AndroidRuntime(12765): at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:588)
07-11 03:26:18.845: E/AndroidRuntime(12765): at com.android.settings.search.SettingsSearchFilterAdapter.getView(SettingsSearchFilterAdapter.java:216)
07-11 03:26:18.845: E/AndroidRuntime(12765): at android.widget.AbsListView.obtainView(AbsListView.java:2255)
07-11 03:26:18.845: E/AndroidRuntime(12765): at android.widget.ListPopupWindow.obtainView(ListPopupWindow.java:1585)
07-11 03:26:18.845: E/AndroidRuntime(12765): at android.widget.ListView.measureHeightOfChildren(ListView.java:1263)
07-11 03:26:18.845: E/AndroidRuntime(12765): at android.widget.ListPopupWindow.buildDropDown(ListPopupWindow.java:1167)
07-11 03:26:18.845: E/AndroidRuntime(12765): at android.widget.ListPopupWindow.show(ListPopupWindow.java:554)
07-11 03:26:18.845: E/AndroidRuntime(12765): at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1096)
07-11 03:26:18.845: E/AndroidRuntime(12765): at android.widget.AutoCompleteTextView.updateDropDownForFilter(AutoCompleteTextView.java:971)
07-11 03:26:18.845: E/AndroidRuntime(12765): at android.widget.AutoCompleteTextView.access00(AutoCompleteTextView.java:91)
07-11 03:26:18.845: E/AndroidRuntime(12765): at android.widget.AutoCompleteTextView.run(AutoCompleteTextView.java:1268)
07-11 03:26:18.845: E/AndroidRuntime(12765): at android.os.Handler.handleCallback(Handler.java:733)
07-11 03:26:18.845: E/AndroidRuntime(12765): at android.os.Handler.dispatchMessage(Handler.java:95)
07-11 03:26:18.845: E/AndroidRuntime(12765): at android.os.Looper.loop(Looper.java:136)
07-11 03:26:18.845: E/AndroidRuntime(12765): at android.app.ActivityThread.main(ActivityThread.java:5140)
07-11 03:26:18.845: E/AndroidRuntime(12765): at java.lang.reflect.Method.invokeNative(Native Method)
07-11 03:26:18.845: E/AndroidRuntime(12765): at java.lang.reflect.Method.invoke(Method.java:515)
07-11 03:26:18.845: E/AndroidRuntime(12765): at com.android.internal.os.ZygoteInit.run(ZygoteInit.java:795)
07-11 03:26:18.845: E/AndroidRuntime(12765): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:611)
07-11 03:26:18.845: E/AndroidRuntime(12765): at dalvik.system.NativeStart.main(Native Method)

Change-Id: I60cff301d3bfb15ea2bbf63fcae524af0ae0b8a6
settings: prevent multiple highlights in settings search

xe: Developer Options -> Launch Tools. The Process Stats is highlighted along
with Launch Tools, because the view of the latter is reused for the former and the
latter later gets a new view. Fix that by making sure to cancel old
highlights when triggering a new one.

Change-Id: Ibf2068628e5024d61495d4f9968811c77e120918
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Fix search highlight matching in some cases.

The attempt at optimizing the loop by skipping the characters that
precede the actual match broke the offset calculations, so the number of
characters skipped in filtering wasn't calculated correctly. Fixit by
removing the misguided optimization.

Example: search for "pera"
highlight in match: Debug non-rectangular cli_p opera_tions
highlight should be: Debug non-rectangular clip o_pera_tions

Change-Id: I07c46b3966e6d81124a5b523c1e822b8750f4f7a
Highlight all search matches for the given constraint.

Change-Id: I9f1a58ee3e6cd59522c4705bedb1457473201d3c