// Path: common/src/main/java/com/matejdro/wearvibrationcenter/common/AppMuteCommand.java
// public class AppMuteCommand implements Parcelable {
//     private final int appIndex;
// 
//     public AppMuteCommand(int appIndex) {
//         this.appIndex = appIndex;
//     }
// 
//     public int getAppIndex() {
//         return appIndex;
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeInt(this.appIndex);
//     }
// 
//     protected AppMuteCommand(Parcel in) {
//         this.appIndex = in.readInt();
//     }
// 
//     public static final Parcelable.Creator<AppMuteCommand> CREATOR = new Parcelable.Creator<AppMuteCommand>() {
//         @Override
//         public AppMuteCommand createFromParcel(Parcel source) {
//             return new AppMuteCommand(source);
//         }
// 
//         @Override
//         public AppMuteCommand[] newArray(int size) {
//             return new AppMuteCommand[size];
//         }
//     };
// }
// 
// Path: common/src/main/java/com/matejdro/wearvibrationcenter/common/CommPaths.java
// public interface CommPaths
// {
//     String PHONE_APP_CAPABILITY = "VibrationCenterPhone";
//     String WATCH_APP_CAPABILITY = "VibrationCenterWatch";
// 
//     String COMMAND_VIBRATE = "/Command/Vibrate";
//     String COMMAND_ALARM = "/Command/Alarm";
//     String COMMAND_APP_MUTE = "/Command/AppMute";
//     String COMMAND_TIMED_MUTE = "/Command/TimedMute";
//     String COMMAND_SEND_LOGS = "/Command/SendLogs";
// 
//     String COMMAND_RECEIVAL_ACKNOWLEDGMENT = "/Ack";
// 
//     String CHANNEL_LOGS = "/Channel/Logs";
// 
//     String LIST_ACTIVE_APPS_NAMES = "/List/ActiveApps/Names";
//     String LIST_ACTIVE_APPS_ICONS = "/List/ActiveApps/Icons";
// 
//     String ASSET_ICON = "Icon";
//     String ASSET_BACKGROUND = "Background";
// 
//     String PREFERENCES_PREFIX = "/Preferences";
// }
// 
// Path: wear/src/main/java/com/matejdro/wearvibrationcenter/preferences/GlobalWatchPreferences.java
// public class GlobalWatchPreferences {
//     public static final PreferenceDefinition<Boolean> DO_NOT_ASK_APP_MUTE_CONFIRM = new SimplePreferenceDefinition<>("do_not_ask_app_mute_confirm", false);
// }


import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.DefaultItemAnimator;
import android.support.wearable.activity.ConfirmationActivity;
import android.support.wearable.view.DefaultOffsettingHelper;
import android.support.wearable.view.WearableRecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.wearable.MessageApi;
import com.google.android.gms.wearable.MessageEvent;
import com.google.android.gms.wearable.Wearable;
import com.matejdro.wearremotelist.parcelables.CompressedParcelableBitmap;
import com.matejdro.wearremotelist.parcelables.StringParcelableWraper;
import com.matejdro.wearremotelist.receiverside.RemoteList;
import com.matejdro.wearremotelist.receiverside.RemoteListListener;
import com.matejdro.wearremotelist.receiverside.RemoteListManager;
import com.matejdro.wearremotelist.receiverside.conn.WatchSingleConnection;
import com.matejdro.wearutils.messages.MessagingUtils;
import com.matejdro.wearutils.messages.ParcelPacker;
import com.matejdro.wearutils.messages.SingleMessageReceiver;
import com.matejdro.wearutils.preferences.definition.Preferences;
import com.matejdro.wearvibrationcenter.R;
import com.matejdro.wearvibrationcenter.common.AppMuteCommand;
import com.matejdro.wearvibrationcenter.common.CommPaths;
import com.matejdro.wearvibrationcenter.preferences.GlobalWatchPreferences;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
            muteApp(positionPendingConfirmation);
        }
    }

    private class MuteExecutor extends AsyncTask<Void, Void, Boolean>
    {
        private final int appIndex;

        public MuteExecutor(int appIndex) {
            this.appIndex = appIndex;
        }

        @Override
        protected void onPreExecute() {
            progressBar.setVisibility(View.VISIBLE);
            recycler.setVisibility(View.GONE);
        }

        @Override
        protected Boolean doInBackground(Void... params) {
            GoogleApiClient googleApiClient = new GoogleApiClient.Builder(AppMuteActivity.this)
                    .addApi(Wearable.API)
                    .build();

            googleApiClient.blockingConnect();

            SingleMessageReceiver ackReceiver = new SingleMessageReceiver(googleApiClient,
                    Uri.parse("wear://*" + CommPaths.COMMAND_RECEIVAL_ACKNOWLEDGMENT),
                    MessageApi.FILTER_LITERAL);

// Path: common/src/main/java/com/matejdro/wearvibrationcenter/common/AppMuteCommand.java
// public class AppMuteCommand implements Parcelable {
//     private final int appIndex;
// 
//     public AppMuteCommand(int appIndex) {
//         this.appIndex = appIndex;
//     }
// 
//     public int getAppIndex() {
//         return appIndex;
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeInt(this.appIndex);
//     }
// 
//     protected AppMuteCommand(Parcel in) {
//         this.appIndex = in.readInt();
//     }
// 
//     public static final Parcelable.Creator<AppMuteCommand> CREATOR = new Parcelable.Creator<AppMuteCommand>() {
//         @Override
//         public AppMuteCommand createFromParcel(Parcel source) {
//             return new AppMuteCommand(source);
//         }
// 
//         @Override
//         public AppMuteCommand[] newArray(int size) {
//             return new AppMuteCommand[size];
//         }
//     };
// }
// 
// Path: common/src/main/java/com/matejdro/wearvibrationcenter/common/CommPaths.java
// public interface CommPaths
// {
//     String PHONE_APP_CAPABILITY = "VibrationCenterPhone";
//     String WATCH_APP_CAPABILITY = "VibrationCenterWatch";
// 
//     String COMMAND_VIBRATE = "/Command/Vibrate";
//     String COMMAND_ALARM = "/Command/Alarm";
//     String COMMAND_APP_MUTE = "/Command/AppMute";
//     String COMMAND_TIMED_MUTE = "/Command/TimedMute";
//     String COMMAND_SEND_LOGS = "/Command/SendLogs";
// 
//     String COMMAND_RECEIVAL_ACKNOWLEDGMENT = "/Ack";
// 
//     String CHANNEL_LOGS = "/Channel/Logs";
// 
//     String LIST_ACTIVE_APPS_NAMES = "/List/ActiveApps/Names";
//     String LIST_ACTIVE_APPS_ICONS = "/List/ActiveApps/Icons";
// 
//     String ASSET_ICON = "Icon";
//     String ASSET_BACKGROUND = "Background";
// 
//     String PREFERENCES_PREFIX = "/Preferences";
// }
// 
// Path: wear/src/main/java/com/matejdro/wearvibrationcenter/preferences/GlobalWatchPreferences.java
// public class GlobalWatchPreferences {
//     public static final PreferenceDefinition<Boolean> DO_NOT_ASK_APP_MUTE_CONFIRM = new SimplePreferenceDefinition<>("do_not_ask_app_mute_confirm", false);
// }


// Path: wear/src/main/java/com/matejdro/wearvibrationcenter/mutepicker/AppMuteActivity.java
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.DefaultItemAnimator;
import android.support.wearable.activity.ConfirmationActivity;
import android.support.wearable.view.DefaultOffsettingHelper;
import android.support.wearable.view.WearableRecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.wearable.MessageApi;
import com.google.android.gms.wearable.MessageEvent;
import com.google.android.gms.wearable.Wearable;
import com.matejdro.wearremotelist.parcelables.CompressedParcelableBitmap;
import com.matejdro.wearremotelist.parcelables.StringParcelableWraper;
import com.matejdro.wearremotelist.receiverside.RemoteList;
import com.matejdro.wearremotelist.receiverside.RemoteListListener;
import com.matejdro.wearremotelist.receiverside.RemoteListManager;
import com.matejdro.wearremotelist.receiverside.conn.WatchSingleConnection;
import com.matejdro.wearutils.messages.MessagingUtils;
import com.matejdro.wearutils.messages.ParcelPacker;
import com.matejdro.wearutils.messages.SingleMessageReceiver;
import com.matejdro.wearutils.preferences.definition.Preferences;
import com.matejdro.wearvibrationcenter.R;
import com.matejdro.wearvibrationcenter.common.AppMuteCommand;
import com.matejdro.wearvibrationcenter.common.CommPaths;
import com.matejdro.wearvibrationcenter.preferences.GlobalWatchPreferences;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

            muteApp(positionPendingConfirmation);
        }
    }

    private class MuteExecutor extends AsyncTask<Void, Void, Boolean>
    {
        private final int appIndex;

        public MuteExecutor(int appIndex) {
            this.appIndex = appIndex;
        }

        @Override
        protected void onPreExecute() {
            progressBar.setVisibility(View.VISIBLE);
            recycler.setVisibility(View.GONE);
        }

        @Override
        protected Boolean doInBackground(Void... params) {
            GoogleApiClient googleApiClient = new GoogleApiClient.Builder(AppMuteActivity.this)
                    .addApi(Wearable.API)
                    .build();

            googleApiClient.blockingConnect();

            SingleMessageReceiver ackReceiver = new SingleMessageReceiver(googleApiClient,
                    Uri.parse("wear://*" + CommPaths.COMMAND_RECEIVAL_ACKNOWLEDGMENT),
                    MessageApi.FILTER_LITERAL);

            AppMuteCommand command = new AppMuteCommand(appIndex);