changed orbot notification icons

This commit is contained in:
Adithya Abraham Philip
2015-08-16 19:47:38 +05:30
parent 6af24527da
commit 93d66d39f7
17 changed files with 12 additions and 7 deletions

View File

@@ -63,8 +63,6 @@ public class KeyserverSyncAdapterService extends Service {
public int onStartCommand(final Intent intent, int flags, final int startId) {
Log.e("PHILIP", "Sync adapter service starting" + intent.getAction());
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
manager.cancel(Constants.Notification.KEYSERVER_SYNC_FAIL_ORBOT);
switch (intent.getAction()) {
case ACTION_CANCEL: {
mCancelled.set(true);
@@ -88,10 +86,14 @@ public class KeyserverSyncAdapterService extends Service {
break;
}
case ACTION_IGNORE_TOR: {
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
manager.cancel(Constants.Notification.KEYSERVER_SYNC_FAIL_ORBOT);
asyncKeyUpdate(this, new CryptoInputParcel(ParcelableProxy.getForNoProxy()));
break;
}
case ACTION_START_ORBOT: {
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
manager.cancel(Constants.Notification.KEYSERVER_SYNC_FAIL_ORBOT);
Intent startOrbot = new Intent(this, OrbotRequiredDialogActivity.class);
startOrbot.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startOrbot.putExtra(OrbotRequiredDialogActivity.EXTRA_START_ORBOT, true);
@@ -126,7 +128,8 @@ public class KeyserverSyncAdapterService extends Service {
break;
}
case ACTION_DISMISS_NOTIFICATION: {
// notification is dismissed at the beginning
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
manager.cancel(Constants.Notification.KEYSERVER_SYNC_FAIL_ORBOT);
stopSelf(startId);
break;
}
@@ -417,7 +420,6 @@ public class KeyserverSyncAdapterService extends Service {
}
private Notification getOrbotNoification(Context context) {
// TODO: PHILIP work in progress
NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
builder.setSmallIcon(R.drawable.ic_stat_notify_24dp)
.setLargeIcon(getBitmap(R.drawable.ic_launcher, context))
@@ -435,7 +437,7 @@ public class KeyserverSyncAdapterService extends Service {
PendingIntent.FLAG_CANCEL_CURRENT
);
builder.addAction(R.drawable.abc_ic_clear_mtrl_alpha,
builder.addAction(R.drawable.ic_stat_tor_off,
context.getString(R.string.keyserver_sync_orbot_notif_ignore),
ignoreTorPi);
@@ -448,7 +450,7 @@ public class KeyserverSyncAdapterService extends Service {
PendingIntent.FLAG_CANCEL_CURRENT
);
builder.addAction(R.drawable.abc_ic_commit_search_api_mtrl_alpha,
builder.addAction(R.drawable.ic_stat_tor,
context.getString(R.string.keyserver_sync_orbot_notif_start),
startOrbotPi
);

View File

@@ -26,11 +26,13 @@ import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
import android.support.v4.app.FragmentActivity;
import android.view.ContextThemeWrapper;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
import org.sufficientlysecure.keychain.ui.util.ThemeChanger;
import org.sufficientlysecure.keychain.util.Log;
import org.sufficientlysecure.keychain.util.ParcelableProxy;
import org.sufficientlysecure.keychain.util.orbot.OrbotHelper;
@@ -75,7 +77,8 @@ public class OrbotRequiredDialogActivity extends FragmentActivity
boolean startOrbotDirect = getIntent().getBooleanExtra(EXTRA_START_ORBOT, false);
if (startOrbotDirect) {
mShowOrbotProgressDialog = new ProgressDialog(this);
ContextThemeWrapper theme = ThemeChanger.getDialogThemeWrapper(this);
mShowOrbotProgressDialog = new ProgressDialog(theme);
mShowOrbotProgressDialog.setTitle(R.string.progress_starting_orbot);
mShowOrbotProgressDialog.setCancelable(false);
mShowOrbotProgressDialog.show();