private void zzs(Bundle paramBundle) {
   paramBundle.remove("message_type");
   paramBundle.remove("android.support.content.wakelockid");
   if (zza.zzt(paramBundle)) {
     zza.zzar(this).zzu(paramBundle);
     return;
   }
   String str = paramBundle.getString("from");
   paramBundle.remove("from");
   onMessageReceived(str, paramBundle);
 }
Example #2
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setRetainInstance(true);
   mContext = getActivity();
   dbhandler = DatabaseHandler.getInstance(mContext);
   savedInstanceState = getArguments();
   if (savedInstanceState != null
       && savedInstanceState.getString("PREFERENCE_SCREEN_KEY") != null) {
     savedInstanceState.remove("PREFERENCE_SCREEN_KEY");
     addPreferencesFromResource(R.xml.pref_year);
     mTitle = getString(R.string.year);
   } else {
     addPreferencesFromResource(R.xml.pref_settings);
     PreferenceScreen preferencescreen = getPreferenceScreen();
     mPush = (CheckBoxPreference) preferencescreen.findPreference("pref_push");
     mYear = preferencescreen.findPreference("pref_year");
     appVersion = preferencescreen.findPreference("appVersion");
     bugReport = preferencescreen.findPreference("bugReport");
     jonny = preferencescreen.findPreference("jonny");
     mTitle = getString(R.string.settings);
     setPrefs();
     setStaticPrefs();
   }
 }
 @Override
 public void restoreInstance(Bundle instance) {
   if (instance.containsKey(Temp.TAG)) {
     temp = instance.getParcelable(Temp.TAG);
     instance.remove(Temp.TAG);
   }
 }
Example #4
0
 public static boolean putJSONValueInBundle(Bundle bundle, String key, Object value) {
   if (value == null) {
     bundle.remove(key);
   } else if (value instanceof Boolean) {
     bundle.putBoolean(key, ((Boolean) value).booleanValue());
   } else if (value instanceof boolean[]) {
     bundle.putBooleanArray(key, (boolean[]) value);
   } else if (value instanceof Double) {
     bundle.putDouble(key, ((Double) value).doubleValue());
   } else if (value instanceof double[]) {
     bundle.putDoubleArray(key, (double[]) value);
   } else if (value instanceof Integer) {
     bundle.putInt(key, ((Integer) value).intValue());
   } else if (value instanceof int[]) {
     bundle.putIntArray(key, (int[]) value);
   } else if (value instanceof Long) {
     bundle.putLong(key, ((Long) value).longValue());
   } else if (value instanceof long[]) {
     bundle.putLongArray(key, (long[]) value);
   } else if (value instanceof String) {
     bundle.putString(key, (String) value);
   } else if (value instanceof JSONArray) {
     bundle.putString(key, ((JSONArray) value).toString());
   } else if (value instanceof JSONObject) {
     bundle.putString(key, ((JSONObject) value).toString());
   } else {
     return false;
   }
   return true;
 }
  @Override
  public void requestSearch(Bundle bundle) {
    if (!bundle.containsKey(SearchManager.QUERY)
        && !bundle.containsKey(Extra.CATEGORY)
        && !bundle.containsKey(Extra.NODETYPE)
        && !bundle.containsKey(Extra.WHEELCHAIR_STATE)) {
      return;
    }

    if (bundle.getInt(Extra.CATEGORY) == Extra.UNKNOWN) {
      bundle.remove(Extra.CATEGORY);
    }

    if (!bundle.containsKey(Extra.WHAT)) {
      int what;
      if (bundle.containsKey(Extra.CATEGORY) || bundle.containsKey(Extra.NODETYPE)) {
        what = What.RETRIEVE_NODES;
      } else {
        what = What.SEARCH_NODES;
      }

      bundle.putInt(Extra.WHAT, what);
    }

    if (bundle.containsKey(Extra.DISTANCE_LIMIT)) {
      bundle.putParcelable(Extra.LOCATION, mLocation);
    }

    bundle.putParcelable(Extra.STATUS_RECEIVER, mReceiver);
    RestServiceHelper.executeRequest(WheelmapApp.getApp(), bundle);
  }
 /**
  * Remove extended data from the request.
  *
  * @see #putExtra
  */
 public void removeExtra(String name) {
   if (mExtras != null) {
     mExtras.remove(name);
     if (mExtras.size() == 0) {
       mExtras = null;
     }
   }
 }
 public static void onSavedInstance(final Bundle outState, final Activity_Main main) {
   try {
     if (main.getGC().isConnected())
       outState.putString("player", Games.Players.getCurrentPlayer(main.getGC()).getDisplayName());
     else outState.remove("player");
   } catch (Exception e) {
     if (BuildConfig.DEBUG) Logger.log(e);
   }
 }
 @Override
 public void onDisconnected() {
   LogHelper.d(TAG, "onDisconnected");
   mSessionExtras.remove(EXTRA_CONNECTED_CAST);
   mSession.setExtras(mSessionExtras);
   Playback playback = new LocalPlayback(MusicService.this, mMusicProvider);
   mMediaRouter.setMediaSession(null);
   switchToPlayer(playback, false);
 }
Example #9
0
 public static void setSlotReservationFlags(
     Bundle extras,
     boolean reservePlayingQueueSlot,
     boolean reserveSkipToNextSlot,
     boolean reserveSkipToPrevSlot) {
   if (reservePlayingQueueSlot) {
     extras.putBoolean(SLOT_RESERVATION_QUEUE, true);
   } else {
     extras.remove(SLOT_RESERVATION_QUEUE);
   }
   if (reserveSkipToPrevSlot) {
     extras.putBoolean(SLOT_RESERVATION_SKIP_TO_PREV, true);
   } else {
     extras.remove(SLOT_RESERVATION_SKIP_TO_PREV);
   }
   if (reserveSkipToNextSlot) {
     extras.putBoolean(SLOT_RESERVATION_SKIP_TO_NEXT, true);
   } else {
     extras.remove(SLOT_RESERVATION_SKIP_TO_NEXT);
   }
 }
Example #10
0
  private void handleIntent(Intent intent) {
    if (intent == null || intent.getExtras() == null) return;

    _fragmentId = intent.getIntExtra("fragmentId", 2);
    Bundle args = (Bundle) intent.getExtras().clone();
    args.remove("fragmentId");
    if (_fragmentId == 2) {
      replaceFragment(PodcastDetailFragment.class, args);
    } else if (_fragmentId == 4) {
      replaceFragment(SubscriptionListFragment.class);
    }
  }
Example #11
0
  protected void initializeData() {
    if (extras != null && extras.containsKey(TOKEN_FILTER)) {
      filter = extras.getParcelable(TOKEN_FILTER);
      extras.remove(
          TOKEN_FILTER); // Otherwise writing this filter to parcel gives infinite recursion
    } else {
      filter = CoreFilterExposer.buildInboxFilter(getResources());
    }
    isInbox = CoreFilterExposer.isInbox(filter);

    setUpTaskList();
    ((AstridActivity) getActivity()).setupActivityFragment(getActiveTagData());

    contextMenuExtensionLoader.loadInNewThread(getActivity());
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final Bundle bundle = getArguments();
    if (bundle != null) {
      final String varValue = bundle.getString(CREATE_VAR_EXTRA_STRING);
      if (!Strings.isEmpty(varValue)) {
        VarEditDialogFragment.showDialog(
            VarEditDialogFragment.Input.newFromValue(varValue), getFragmentManager());

        // in order to stop intent for other tabs
        bundle.remove(CREATE_VAR_EXTRA_STRING);
      }
    }

    setHasOptionsMenu(true);
  }
Example #13
0
 MetadataBundle(int paramInt, Bundle paramBundle) {
   mVersionCode = paramInt;
   zzawD = ((Bundle) zzv.zzz(paramBundle));
   zzawD.setClassLoader(getClass().getClassLoader());
   paramBundle = new ArrayList();
   Object localObject = zzawD.keySet().iterator();
   while (((Iterator) localObject).hasNext()) {
     String str = (String) ((Iterator) localObject).next();
     if (zze.zzcx(str) == null) {
       paramBundle.add(str);
       zzx.zzC("MetadataBundle", "Ignored unknown metadata field in bundle: " + str);
     }
   }
   paramBundle = paramBundle.iterator();
   while (paramBundle.hasNext()) {
     localObject = (String) paramBundle.next();
     zzawD.remove((String) localObject);
   }
 }
Example #14
0
  protected void initializeData() {
    if (extras != null && extras.containsKey(TOKEN_FILTER)) {
      filter = extras.getParcelable(TOKEN_FILTER);
      extras.remove(
          TOKEN_FILTER); // Otherwise writing this filter to parcel gives infinite recursion
    } else {
      filter = CoreFilterExposer.buildInboxFilter(resources);
    }
    filter.setFilterQueryOverride(null);
    isInbox = CoreFilterExposer.isInbox(filter);
    isTodayFilter = false;
    if (!isInbox) {
      isTodayFilter = CoreFilterExposer.isTodayFilter(filter);
    }

    initializeTaskListMetadata();

    setUpTaskList();
    ((AstridActivity) getActivity()).setupActivityFragment(getActiveTagData());
  }
 @Override
 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
   switch (requestCode) {
     case REQUEST_INSTALL_PACKAGE:
       {
         Log.w(TAG, "Received REQUEST_INSTALL_PACKAGE, resultCode = " + resultCode);
         if (mOriginalSettings.containsKey(INSTALL_NON_MARKET_APPS)) {
           // Restore original setting
           setAllowNonMarket(mOriginalSettings.getBoolean(INSTALL_NON_MARKET_APPS));
           mOriginalSettings.remove(INSTALL_NON_MARKET_APPS);
         }
         finish();
         break;
       }
     default:
       {
         Log.wtf(TAG, "Unknown requestCode " + requestCode + "; data = " + data);
         break;
       }
   }
 }
Example #16
0
 public Notification b() {
   Notification notification = a.build();
   Object obj = cy.a(notification);
   Bundle bundle = new Bundle(b);
   Iterator iterator = b.keySet().iterator();
   do {
     if (!iterator.hasNext()) {
       break;
     }
     String s = (String) iterator.next();
     if (((Bundle) (obj)).containsKey(s)) {
       bundle.remove(s);
     }
   } while (true);
   ((Bundle) (obj)).putAll(bundle);
   obj = cy.a(c);
   if (obj != null) {
     cy.a(notification)
         .putSparseParcelableArray(
             "android.support.actionExtras", ((android.util.SparseArray) (obj)));
   }
   return notification;
 }
    @Override
    public void onEditContactAction(Uri contactLookupUri) {
      Bundle extras = getIntent().getExtras();
      if (launchAddToContactDialog(extras)) {
        // Show a confirmation dialog to add the value(s) to the existing contact.
        Intent intent = new Intent(ScContactSelectionActivity.this, ConfirmAddDetailActivity.class);
        intent.setData(contactLookupUri);
        if (extras != null) {
          // First remove name key if present because the dialog does not support name
          // editing. This is fine because the user wants to add information to an
          // existing contact, who should already have a name and we wouldn't want to
          // override the name.
          extras.remove(Insert.NAME);
          intent.putExtras(extras);
        }

        // Wait for the activity result because we want to keep the picker open (in case the
        // user cancels adding the info to a contact and wants to pick someone else).
        startActivityForResult(intent, SUB_ACTIVITY_ADD_TO_EXISTING_CONTACT);
      } else {
        // Otherwise launch the full contact editor.
        startActivityAndForwardResult(new Intent(Intent.ACTION_EDIT, contactLookupUri));
      }
    }
 private void unlogChange(java.lang.String field) {
   if (changeLog != null) {
     changeLog.remove(field);
   }
 }
  public void handleMessage(Message msg) {
    if (msg == null) {
      return;
    }
    switch (msg.what) {
        // 라디오목록 가져오기 완료.
      case Constants.HANDLER_MESSAGE_GET_RADIO_CHANNEL_TASK:
        RadioChannelInfo data = (RadioChannelInfo) msg.obj;

        dismissProgressDialog();
        if (data != null && Constants.RESULT_OK.equals(data.getResultCode())) {
          mRadioChannelItems = data.getRadioChannelList();
          if (mRadioChannelItems == null) {
            mRadioChannelItems = new ArrayList<>();
          }
        } else {
          if (mRadioChannelItems == null) {
            mRadioChannelItems = new ArrayList<>();
          }

          if (data == null) {
            data = new RadioChannelInfo();
            data.setResultMessage(getString(R.string.server_connection_error));
          }

          Intent i = new Intent(this, MusicService.class);
          i.setAction(MusicService.ACTION_STOP);
          i.putExtra(MusicService.EXTRA_MUSIC_FORCE_STOP, true);
          startService(i);

          AlertDialog.Builder alert = new AlertDialog.Builder(this);
          alert.setPositiveButton(
              R.string.alert_ok,
              new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                  dialog.dismiss();
                  // finish();
                }
              });
          alert.setMessage(data.getResultMessage());
          try {
            alert.show();
          } catch (Exception e) {

          }
        }
        mIsExecuteGetRadioChannelTask = false;
        getRadioChannelTask = null;

        setupRadioChannelPager();
        break;
        // 라디오재생 요청에 대한 타임아웃. 미디어서비스에서 응답시간에 대한 타임아웃
      case Constants.HANDLER_MESSAGE_PLAY_RADIO_CHANNEL_TIMEOUT:
        Intent i = new Intent(this, MusicService.class);
        i.setAction(MusicService.ACTION_STOP);
        i.putExtra(MusicService.EXTRA_MUSIC_FORCE_STOP, true);
        startService(i);
        break;

        // 볼륨키로 볼륨조절 시
      case HANDLER_MESSAGE_STREAM_MUSIC_VOLUME_CHANGE:
        int currentVolume = msg.arg1;
        if (currentVolume <= 0) {
          mSoundToggle.setBackgroundResource(R.drawable.ic_button_radio_sound_off);
        } else {
          mSoundToggle.setBackgroundResource(R.drawable.ic_button_radio_sound_on);
        }
        mSeekbar.setProgress(currentVolume);
        break;

        // 플레이어컨트롤
      case HANDLER_MESSAGE_MUSIC_SERVICE_ACTION:
        Bundle b = msg.getData();
        if (b == null) {
          Log.i(TAG, "HANDLER_MESSAGE_MUSIC_SERVICE_ACTION bundle is not found!!");
          return;
        }
        String action = b.getString(MusicService.EXTRA_ACTION);
        MusicService.State state =
            (MusicService.State) b.getSerializable(MusicService.EXTRA_PLAYING_STATUS);
        MusicRetriever.Item item = b.getParcelable(MusicService.EXTRA_MUSIC_ITEM);

        if (state == MusicService.State.Playing) {
          mPlayToggle.setBackgroundResource(R.drawable.ic_btn_radio_pause_selector);
          mRadioTitle.setText(item.getTitle());
        } else if (state == MusicService.State.Paused) {
          mPlayToggle.setBackgroundResource(R.drawable.ic_btn_radio_play_selector);
          mRadioTitle.setText(item.getTitle());
        } else if (state == MusicService.State.Stopped) {
          mPlayToggle.setBackgroundResource(R.drawable.ic_btn_radio_play_selector);
          b.remove(MusicService.EXTRA_MUSIC_ITEM);
          mRadioTitle.setText(R.string.activity_radio_default_title);
        } else {
          mRadioTitle.setText(R.string.activity_radio_default_title);
        }
        mCurrentPlayingStatus = b;
        for (int idx = 0; idx < mActivityInteractionListener.size(); idx++) {
          mActivityInteractionListener.get(idx).onPlayItemChanged(b);
        }

        if (!mIsExecuteGetRadioChannelTask) {
          mHandler.sendEmptyMessageDelayed(HANDLER_MESSAGE_HIDE_PROGRESS_DIALOG, 1500);
        }
        break;

        // 프로그레스바 제거
      case HANDLER_MESSAGE_HIDE_PROGRESS_DIALOG:
        dismissProgressDialog();
        break;
    }
  }
Example #20
0
 private void removeFalseExtra(String extraName) {
   if (!extras.getBoolean(extraName, false)) {
     extras.remove(extraName);
   }
 }
 public static void cleanSettingReplaceVariables(Bundle b) {
   b.remove(Setting.BUNDLE_KEY_VARIABLE_REPLACE_STRINGS);
 }
 public static void cleanRequestedTimeout(Bundle extras) {
   extras.remove(Setting.EXTRA_REQUESTED_TIMEOUT);
 }
 public static void cleanRelevantVariables(Bundle b) {
   b.remove(BUNDLE_KEY_RELEVANT_VARIABLES);
 }
  void processFreEnvironment(boolean androidEduDevice, boolean hasChildAccount) {
    if (isFirstRunFlowComplete()) {
      assert isFirstRunEulaAccepted();
      // We do not need any interactive FRE.
      onFlowIsKnown(null);
      return;
    }

    Bundle freProperties = new Bundle();
    freProperties.putAll(mLaunchProperties);
    freProperties.remove(FirstRunActivity.EXTRA_USE_FRE_FLOW_SEQUENCER);

    Account[] googleAccounts = getGoogleAccounts();
    boolean onlyOneAccount = googleAccounts.length == 1;

    // EDU devices should always have exactly 1 google account, which will be automatically
    // signed-in. All FRE screens are skipped in this case.
    boolean forceEduSignIn = androidEduDevice && onlyOneAccount && !isSignedIn();

    // In the full FRE we always show the Welcome page, except on EDU devices.
    boolean showWelcomePage = !forceEduSignIn;
    freProperties.putBoolean(FirstRunActivity.SHOW_WELCOME_PAGE, showWelcomePage);

    // Initialize usage and crash reporting according to the default value.
    // The user can explicitly enable or disable the reporting on the Welcome page.
    // This is controlled by the administrator via a policy on EDU devices.
    setDefaultMetricsAndCrashReporting();

    // We show the sign-in page if sync is allowed, and not signed in, and this is not an EDU
    // device, and
    // - no "skip the first use hints" is set, or
    // - "skip the first use hints" is set, but there is at least one account.
    final boolean offerSignInOk =
        isSyncAllowed()
            && !isSignedIn()
            && !forceEduSignIn
            && (!shouldSkipFirstUseHints() || googleAccounts.length > 0);
    freProperties.putBoolean(FirstRunActivity.SHOW_SIGNIN_PAGE, offerSignInOk);

    if (offerSignInOk || forceEduSignIn) {
      // If the user has accepted the ToS in the Setup Wizard and there is exactly
      // one account, or if the device has a child account, or if the device is an
      // Android EDU device and there is exactly one account, preselect the sign-in
      // account and force the selection if necessary.
      if ((hasAnyUserSeenToS() && onlyOneAccount) || hasChildAccount || forceEduSignIn) {
        freProperties.putString(
            AccountFirstRunFragment.FORCE_SIGNIN_ACCOUNT_TO, googleAccounts[0].name);
        freProperties.putBoolean(
            AccountFirstRunFragment.PRESELECT_BUT_ALLOW_TO_CHANGE,
            !forceEduSignIn && !hasChildAccount);
      }
    }

    freProperties.putBoolean(AccountFirstRunFragment.IS_CHILD_ACCOUNT, hasChildAccount);

    freProperties.putBoolean(
        FirstRunActivity.SHOW_DATA_REDUCTION_PAGE, shouldShowDataReductionPage());

    onFlowIsKnown(freProperties);
    if (hasChildAccount || forceEduSignIn) {
      // Child and Edu forced signins are processed independently.
      setFirstRunFlowSignInComplete();
    }
  }