mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-23 04:41:16 +00:00
Removed unused compatibility code.
This commit is contained in:
parent
9c830c1545
commit
34fead0623
2 changed files with 4 additions and 17 deletions
|
@ -1,6 +1,5 @@
|
|||
package com.nutomic.syncthingandroid.test;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
||||
|
@ -92,7 +91,6 @@ public class MockRestApi extends RestApi {
|
|||
}
|
||||
|
||||
@Override
|
||||
@TargetApi(11)
|
||||
public void copyDeviceId(String id) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
package com.nutomic.syncthingandroid.syncthing;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
@ -1028,19 +1025,11 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
|
|||
*
|
||||
* @param id The device ID to copy.
|
||||
*/
|
||||
@TargetApi(11)
|
||||
public void copyDeviceId(String id) {
|
||||
int sdk = android.os.Build.VERSION.SDK_INT;
|
||||
if (sdk < android.os.Build.VERSION_CODES.HONEYCOMB) {
|
||||
android.text.ClipboardManager clipboard = (android.text.ClipboardManager)
|
||||
mContext.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
clipboard.setText(id);
|
||||
} else {
|
||||
ClipboardManager clipboard = (ClipboardManager)
|
||||
mContext.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData clip = ClipData.newPlainText(mContext.getString(R.string.device_id), id);
|
||||
clipboard.setPrimaryClip(clip);
|
||||
}
|
||||
Toast.makeText(mContext, R.string.device_id_copied_to_clipboard, Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue