Move GenericAccountService to common.

Also guarded setRefreshActionButtonState() against being called on
pre-HC devices, since they don't support ActionItems.

Change-Id: Ibd1639a77b33ca19559c867b35c334ed44b38ea4
diff --git a/networking/sync/BasicSyncAdapter/src/com/example/android/network/sync/basicsyncadapter/accounts/GenericAccountService.java b/common/src/com/example/android/common/accounts/GenericAccountService.java
similarity index 98%
rename from networking/sync/BasicSyncAdapter/src/com/example/android/network/sync/basicsyncadapter/accounts/GenericAccountService.java
rename to common/src/com/example/android/common/accounts/GenericAccountService.java
index b5dc98e..9480023 100644
--- a/networking/sync/BasicSyncAdapter/src/com/example/android/network/sync/basicsyncadapter/accounts/GenericAccountService.java
+++ b/common/src/com/example/android/common/accounts/GenericAccountService.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.example.android.network.sync.basicsyncadapter.accounts;
+package com.example.android.common.accounts;
 
 import android.accounts.AbstractAccountAuthenticator;
 import android.accounts.Account;
diff --git a/networking/sync/BasicSyncAdapter/AndroidManifest.xml b/networking/sync/BasicSyncAdapter/AndroidManifest.xml
index f8434bb..385b293 100644
--- a/networking/sync/BasicSyncAdapter/AndroidManifest.xml
+++ b/networking/sync/BasicSyncAdapter/AndroidManifest.xml
@@ -69,7 +69,7 @@
 
         It's also possible to attach a SyncAdapter to an existing account provided by another
         package. In that case, this element could be omitted here. -->
-        <service android:name=".accounts.GenericAccountService">
+        <service android:name="com.example.android.common.accounts.GenericAccountService">
             <!-- Required filter used by the system to launch our account service. -->
             <intent-filter>
                 <action android:name="android.accounts.AccountAuthenticator" />
diff --git a/networking/sync/BasicSyncAdapter/src/com/example/android/common b/networking/sync/BasicSyncAdapter/src/com/example/android/common
new file mode 120000
index 0000000..943c4a2
--- /dev/null
+++ b/networking/sync/BasicSyncAdapter/src/com/example/android/common
@@ -0,0 +1 @@
+../../../../../../../common/src/com/example/android/common
\ No newline at end of file
diff --git a/networking/sync/BasicSyncAdapter/src/com/example/android/network/sync/basicsyncadapter/EntryListFragment.java b/networking/sync/BasicSyncAdapter/src/com/example/android/network/sync/basicsyncadapter/EntryListFragment.java
index b1f55b6..0efeb40 100644
--- a/networking/sync/BasicSyncAdapter/src/com/example/android/network/sync/basicsyncadapter/EntryListFragment.java
+++ b/networking/sync/BasicSyncAdapter/src/com/example/android/network/sync/basicsyncadapter/EntryListFragment.java
@@ -17,12 +17,14 @@
 package com.example.android.network.sync.basicsyncadapter;
 
 import android.accounts.Account;
+import android.annotation.TargetApi;
 import android.app.Activity;
 import android.content.ContentResolver;
 import android.content.Intent;
 import android.content.SyncStatusObserver;
 import android.database.Cursor;
 import android.net.Uri;
+import android.os.Build;
 import android.os.Bundle;
 import android.support.v4.app.ListFragment;
 import android.support.v4.app.LoaderManager;
@@ -38,7 +40,7 @@
 import android.widget.ListView;
 import android.widget.TextView;
 
-import com.example.android.network.sync.basicsyncadapter.accounts.GenericAccountService;
+import com.example.android.common.accounts.GenericAccountService;
 import com.example.android.network.sync.basicsyncadapter.provider.FeedContract;
 
 /**
@@ -295,8 +297,9 @@
      *
      * @param refreshing True if an active sync is occuring, false otherwise
      */
+    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
     public void setRefreshActionButtonState(boolean refreshing) {
-        if (mOptionsMenu == null) {
+        if (mOptionsMenu == null || Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
             return;
         }
 
diff --git a/networking/sync/BasicSyncAdapter/src/com/example/android/network/sync/basicsyncadapter/SyncUtils.java b/networking/sync/BasicSyncAdapter/src/com/example/android/network/sync/basicsyncadapter/SyncUtils.java
index bf3e76c..c6552da 100644
--- a/networking/sync/BasicSyncAdapter/src/com/example/android/network/sync/basicsyncadapter/SyncUtils.java
+++ b/networking/sync/BasicSyncAdapter/src/com/example/android/network/sync/basicsyncadapter/SyncUtils.java
@@ -23,7 +23,7 @@
 import android.os.Bundle;
 import android.preference.PreferenceManager;
 
-import com.example.android.network.sync.basicsyncadapter.accounts.GenericAccountService;
+import com.example.android.common.accounts.GenericAccountService;
 import com.example.android.network.sync.basicsyncadapter.provider.FeedContract;
 
 /**