/** Called by the Binder stub. */
  void dump(String[] args, PrintWriter pw) {
    synchronized (mLock) {
      final long screenOnTime = getScreenOnTimeLocked(checkAndGetTimeLocked());
      IndentingPrintWriter idpw = new IndentingPrintWriter(pw, "  ");
      ArraySet<String> argSet = new ArraySet<>();
      argSet.addAll(Arrays.asList(args));

      final int userCount = mUserState.size();
      for (int i = 0; i < userCount; i++) {
        idpw.printPair("user", mUserState.keyAt(i));
        idpw.println();
        idpw.increaseIndent();
        if (argSet.contains("--checkin")) {
          mUserState.valueAt(i).checkin(idpw, screenOnTime);
        } else {
          mUserState.valueAt(i).dump(idpw, screenOnTime);
          idpw.println();
          if (args.length > 0 && "history".equals(args[0])) {
            mAppIdleHistory.dump(idpw, mUserState.keyAt(i));
          }
        }
        idpw.decreaseIndent();
      }
      pw.write("Screen On Timebase:" + mScreenOnTime + "\n");
    }
  }
Пример #2
0
 /**
  * Read as much as possible from the tag with the given key information.
  *
  * @param keyMap Keys (A and B) mapped to a sector. See {@link #buildNextKeyMapPart()}.
  * @return A Key-Value Pair. Keys are the sector numbers, values are the tag data. This tag data
  *     (values) are arrays containing one block per field (index 0-3 or 0-15). If a block is
  *     "null" it means that the block couldn't be read with the given key information.<br>
  *     On Error "null" will be returned (tag was removed during reading or keyMap is null). If
  *     none of the keys in the key map is valid for reading and therefore no sector is read, an
  *     empty set (SparseArray.size() == 0) will be returned.
  * @see #buildNextKeyMapPart()
  */
 public SparseArray<String[]> readAsMuchAsPossible(SparseArray<byte[][]> keyMap) {
   SparseArray<String[]> ret = null;
   if (keyMap != null && keyMap.size() > 0) {
     ret = new SparseArray<String[]>(keyMap.size());
     // For all entries in map do:
     for (int i = 0; i < keyMap.size(); i++) {
       String[][] results = new String[2][];
       try {
         if (keyMap.valueAt(i)[0] != null) {
           // Read with key A.
           results[0] = readSector(keyMap.keyAt(i), keyMap.valueAt(i)[0], false);
         }
         if (keyMap.valueAt(i)[1] != null) {
           // Read with key B.
           results[1] = readSector(keyMap.keyAt(i), keyMap.valueAt(i)[1], true);
         }
       } catch (TagLostException e) {
         return null;
       }
       // Merge results.
       if (results[0] != null || results[1] != null) {
         ret.put(keyMap.keyAt(i), mergeSectorData(results[0], results[1]));
       }
     }
     return ret;
   }
   return ret;
 }
 private void printHistogram(PrintStream writer, SparseArray<Integer> histogram) {
   writer.println();
   writer.println("File Size Counts:");
   for (int i = 1; i < histogram.size(); i++) {
     int lb = histogram.keyAt(i - 1);
     int ub = histogram.keyAt(i);
     writer.println(formatStrLocaleSafe("%4d-%4dK: %3d", lb, ub, histogram.get(ub)));
   }
 }
Пример #4
0
 @Override
 public void stopAllThread() {
   for (int index = 0, size = mRequestThreads.size(); index < size; index++) {
     int key = mRequestThreads.keyAt(index);
     stopRequestThread(key);
   }
   for (int index = 0, size = mDownloadThreads.size(); index < size; index++) {
     int key = mDownloadThreads.keyAt(index);
     stopDownloadThread(key);
   }
 }
Пример #5
0
  public static void debugMotionEvent(MotionEvent motionEvent) {
    SparseArray<String> names = new SparseArray<String>();
    names.append(MotionEvent.AXIS_X, "AXIS_X");
    names.append(MotionEvent.AXIS_Y, "AXIS_Y");
    names.append(MotionEvent.AXIS_PRESSURE, "AXIS_PRESSURE");
    names.append(MotionEvent.AXIS_SIZE, "AXIS_SIZE");
    names.append(MotionEvent.AXIS_TOUCH_MAJOR, "AXIS_TOUCH_MAJOR");
    names.append(MotionEvent.AXIS_TOUCH_MINOR, "AXIS_TOUCH_MINOR");
    names.append(MotionEvent.AXIS_TOOL_MAJOR, "AXIS_TOOL_MAJOR");
    names.append(MotionEvent.AXIS_TOOL_MINOR, "AXIS_TOOL_MINOR");
    names.append(MotionEvent.AXIS_ORIENTATION, "AXIS_ORIENTATION");
    names.append(MotionEvent.AXIS_VSCROLL, "AXIS_VSCROLL");
    names.append(MotionEvent.AXIS_HSCROLL, "AXIS_HSCROLL");
    names.append(MotionEvent.AXIS_Z, "AXIS_Z");
    names.append(MotionEvent.AXIS_RX, "AXIS_RX");
    names.append(MotionEvent.AXIS_RY, "AXIS_RY");
    names.append(MotionEvent.AXIS_RZ, "AXIS_RZ");
    names.append(MotionEvent.AXIS_HAT_X, "AXIS_HAT_X");
    names.append(MotionEvent.AXIS_HAT_Y, "AXIS_HAT_Y");
    names.append(MotionEvent.AXIS_LTRIGGER, "AXIS_LTRIGGER");
    names.append(MotionEvent.AXIS_RTRIGGER, "AXIS_RTRIGGER");
    names.append(MotionEvent.AXIS_THROTTLE, "AXIS_THROTTLE");
    names.append(MotionEvent.AXIS_RUDDER, "AXIS_RUDDER");
    names.append(MotionEvent.AXIS_WHEEL, "AXIS_WHEEL");
    names.append(MotionEvent.AXIS_GAS, "AXIS_GAS");
    names.append(MotionEvent.AXIS_BRAKE, "AXIS_BRAKE");
    names.append(MotionEvent.AXIS_DISTANCE, "AXIS_DISTANCE");
    names.append(MotionEvent.AXIS_TILT, "AXIS_TILT");
    names.append(MotionEvent.AXIS_GENERIC_1, "AXIS_GENERIC_1");
    names.append(MotionEvent.AXIS_GENERIC_2, "AXIS_GENERIC_2");
    names.append(MotionEvent.AXIS_GENERIC_3, "AXIS_GENERIC_3");
    names.append(MotionEvent.AXIS_GENERIC_4, "AXIS_GENERIC_4");
    names.append(MotionEvent.AXIS_GENERIC_5, "AXIS_GENERIC_5");
    names.append(MotionEvent.AXIS_GENERIC_6, "AXIS_GENERIC_6");
    names.append(MotionEvent.AXIS_GENERIC_7, "AXIS_GENERIC_7");
    names.append(MotionEvent.AXIS_GENERIC_8, "AXIS_GENERIC_8");
    names.append(MotionEvent.AXIS_GENERIC_9, "AXIS_GENERIC_9");
    names.append(MotionEvent.AXIS_GENERIC_10, "AXIS_GENERIC_10");
    names.append(MotionEvent.AXIS_GENERIC_11, "AXIS_GENERIC_11");
    names.append(MotionEvent.AXIS_GENERIC_12, "AXIS_GENERIC_12");
    names.append(MotionEvent.AXIS_GENERIC_13, "AXIS_GENERIC_13");
    names.append(MotionEvent.AXIS_GENERIC_14, "AXIS_GENERIC_14");
    names.append(MotionEvent.AXIS_GENERIC_15, "AXIS_GENERIC_15");
    names.append(MotionEvent.AXIS_GENERIC_16, "AXIS_GENERIC_16");

    int source = motionEvent.getSource();

    final int count = names.size();
    for (int i = 0; i < count; i++) {
      float val = motionEvent.getAxisValue(names.keyAt(i));
      Log.i(TAG, "(" + names.keyAt(i) + ") " + names.valueAt(i) + "=" + val + " source=" + source);
    }
  }
  protected void setupSingleChoiceDialog(AlertDialog.Builder builder) {
    final List<ItemT> availableItems = getAvailableItems();

    final ItemPrinter<ItemT> ip = getItemPrinter();
    CharSequence[] items = new CharSequence[availableItems.size()];
    for (int i = 0; i < availableItems.size(); ++i) {
      items[i] = ip.itemToString(availableItems.get(i));
    }

    int checked = -1;
    if (selectedItems.size() > 0) {
      checked = selectedItems.keyAt(0);
      selectedItems.put(checked, getItemAt(checked));
    }

    builder.setSingleChoiceItems(
        items,
        checked,
        new DialogInterface.OnClickListener() {
          @Override
          public void onClick(DialogInterface dialog, int which) {
            selectedItems.clear();
            selectedItems.put(which, getItemAt(which));
          }
        });
  }
Пример #7
0
 public static User getUser(String phone) {
   for (int i = 0; i < users.size(); i++) {
     User user = users.get(users.keyAt(i));
     if (user.phone != null && user.phone.equals(phone)) return user;
   }
   return null;
 }
 /** 界面销毁回调函数 */
 @Override
 protected void onDestroy() {
   super.onDestroy();
   BaseApplication.removeActivity(this);
   if (codeToListenerMap != null) {
     final int nCount = codeToListenerMap.size();
     for (int nIndex = 0; nIndex < nCount; ++nIndex) {
       removeCallbackEventListener(codeToListenerMap.keyAt(nIndex));
     }
     codeToListenerMap.clear();
   }
   requestCodeOfCustomerCardRelatedInfoDown = 0;
   requestCodeForOrderScuessToupdateCustomer = 0;
   requestCodeForEditCustomer = 0;
   toastManager = null; // 提示管理器
   mContext = null; // 上下文
   baseAttribute = null; // 基础属性抽象
   clickView = null; // 点击VIEW
   avatarDisplayImageOptions = null; // 圆角头像参数
   defaultDisplayImageOptions = null; // 默认参数
   clickedViewId = 0; // 点击VIEWID
   eventCode = 0; // 事件编码
   // 设置空的布局快速释放内存
   setContentView(R.layout.a_a_null_view);
   // 强制清理此Activity对象资源
   System.gc();
 }
  private void dumpInternal(PrintWriter pw) {
    pw.println("DISPLAY MANAGER (dumpsys display)");

    synchronized (mSyncRoot) {
      pw.println("  mOnlyCode=" + mOnlyCore);
      pw.println("  mSafeMode=" + mSafeMode);
      pw.println("  mPendingTraversal=" + mPendingTraversal);
      pw.println("  mGlobalDisplayState=" + Display.stateToString(mGlobalDisplayState));
      pw.println("  mNextNonDefaultDisplayId=" + mNextNonDefaultDisplayId);
      pw.println("  mDefaultViewport=" + mDefaultViewport);
      pw.println("  mExternalTouchViewport=" + mExternalTouchViewport);
      pw.println("  mSingleDisplayDemoMode=" + mSingleDisplayDemoMode);
      pw.println("  mWifiDisplayScanRequestCount=" + mWifiDisplayScanRequestCount);

      IndentingPrintWriter ipw = new IndentingPrintWriter(pw, "    ");
      ipw.increaseIndent();

      pw.println();
      pw.println("Display Adapters: size=" + mDisplayAdapters.size());
      for (DisplayAdapter adapter : mDisplayAdapters) {
        pw.println("  " + adapter.getName());
        adapter.dumpLocked(ipw);
      }

      pw.println();
      pw.println("Display Devices: size=" + mDisplayDevices.size());
      for (DisplayDevice device : mDisplayDevices) {
        pw.println("  " + device.getDisplayDeviceInfoLocked());
        device.dumpLocked(ipw);
      }

      final int logicalDisplayCount = mLogicalDisplays.size();
      pw.println();
      pw.println("Logical Displays: size=" + logicalDisplayCount);
      for (int i = 0; i < logicalDisplayCount; i++) {
        int displayId = mLogicalDisplays.keyAt(i);
        LogicalDisplay display = mLogicalDisplays.valueAt(i);
        pw.println("  Display " + displayId + ":");
        display.dumpLocked(ipw);
      }

      final int callbackCount = mCallbacks.size();
      pw.println();
      pw.println("Callbacks: size=" + callbackCount);
      for (int i = 0; i < callbackCount; i++) {
        CallbackRecord callback = mCallbacks.valueAt(i);
        pw.println(
            "  "
                + i
                + ": mPid="
                + callback.mPid
                + ", mWifiDisplayScanRequested="
                + callback.mWifiDisplayScanRequested);
      }

      if (mDisplayPowerController != null) {
        mDisplayPowerController.dump(pw);
      }
    }
  }
 @Override
 protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
   if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP)
       != PackageManager.PERMISSION_GRANTED) {
     pw.println(
         "Permission Denial: can't dump torch service from from pid="
             + Binder.getCallingPid()
             + ", uid="
             + Binder.getCallingUid());
     return;
   }
   pw.println("Current torch service state:");
   pw.println(" Active cameras:");
   for (int i = 0; i < mCamerasInUse.size(); i++) {
     int cameraId = mCamerasInUse.keyAt(i);
     CameraUserRecord record = mCamerasInUse.valueAt(i);
     boolean isTorch = cameraId == mTorchCameraId;
     pw.print(" Camera " + cameraId + " (" + (isTorch ? "torch" : "camera"));
     pw.println("): pid=" + record.pid + "; uid=" + record.uid);
   }
   pw.println(" mTorchEnabled=" + mTorchEnabled);
   pw.println(" mTorchAvailable=" + mTorchAvailable);
   pw.println(" mTorchAppUid=" + mTorchAppUid);
   pw.println(" mTorchCameraId=" + mTorchCameraId);
   pw.println(" mCameraDevice=" + mCameraDevice);
   pw.println(" mOpeningCamera=" + mOpeningCamera);
 }
 static {
   CMD_NAMES.append(CMD_NAV_LINE_PREVIOUS, "CMD_NAV_LINE_PREVIOUS");
   CMD_NAMES.append(CMD_NAV_LINE_NEXT, "CMD_NAV_LINE_NEXT");
   CMD_NAMES.append(CMD_NAV_ITEM_PREVIOUS, "CMD_NAV_ITEM_PREVIOUS");
   CMD_NAMES.append(CMD_NAV_ITEM_NEXT, "CMD_NAV_ITEM_NEXT");
   CMD_NAMES.append(CMD_NAV_PAN_LEFT, "CMD_NAV_PAN_LEFT");
   CMD_NAMES.append(CMD_NAV_PAN_RIGHT, "CMD_NAV_PAN_RIGHT");
   CMD_NAMES.append(CMD_NAV_TOP, "CMD_NAV_TOP");
   CMD_NAMES.append(CMD_NAV_BOTTOM, "CMD_NAV_BOTTOM");
   CMD_NAMES.append(CMD_ACTIVATE_CURRENT, "CMD_ACTIVATE_CURRENT");
   CMD_NAMES.append(CMD_SCROLL_BACKWARD, "CMD_SCROLL_BACKWARD");
   CMD_NAMES.append(CMD_SCROLL_FORWARD, "CMD_SCROLL_FORWARD");
   CMD_NAMES.append(CMD_SELECTION_START, "CMD_SELECTION_START");
   CMD_NAMES.append(CMD_SELECTION_END, "CMD_SELECTION_END");
   CMD_NAMES.append(CMD_SELECTION_SELECT_ALL, "CMD_SELECTION_SELECT_ALL");
   CMD_NAMES.append(CMD_SELECTION_CUT, "CMD_SELECTION_CUT");
   CMD_NAMES.append(CMD_SELECTION_COPY, "CMD_SELECTION_COPY");
   CMD_NAMES.append(CMD_SELECTION_PASTE, "CMD_SELECTION_PASTE");
   CMD_NAMES.append(CMD_ROUTE, "CMD_ROUTE");
   CMD_NAMES.append(CMD_BRAILLE_KEY, "CMD_BRAILLE_KEY");
   CMD_NAMES.append(CMD_KEY_ENTER, "CMD_KEY_ENTER");
   CMD_NAMES.append(CMD_KEY_DEL, "CMD_KEY_DEL");
   CMD_NAMES.append(CMD_KEY_FORWARD_DEL, "CMD_KEY_FORWARD_DEL");
   CMD_NAMES.append(CMD_GLOBAL_BACK, "CMD_GLOBAL_BACK");
   CMD_NAMES.append(CMD_GLOBAL_HOME, "CMD_GLOBAL_HOME");
   CMD_NAMES.append(CMD_GLOBAL_RECENTS, "CMD_GLOBAL_RECENTS");
   CMD_NAMES.append(CMD_GLOBAL_NOTIFICATIONS, "CMD_GLOBAL_NOTIFICATIONS");
   CMD_NAMES.append(CMD_HELP, "CMD_HELP");
   for (int i = 0; i < CMD_NAMES.size(); ++i) {
     NAMES_TO_CMDS.put(CMD_NAMES.valueAt(i), CMD_NAMES.keyAt(i));
   }
 }
Пример #12
0
 public final void aCs()
 {
   if ((has == null) || (has.size() <= 0)) {
     return;
   }
   int i = 0;
   label20:
   int j;
   if (i < has.size())
   {
     j = has.keyAt(i);
     if (has.get(j) != null) {
       break label68;
     }
   }
   label68:
   for (SmileyGrid localSmileyGrid = null;; localSmileyGrid = (SmileyGrid)((SoftReference)has.get(j)).get())
   {
     if (localSmileyGrid != null) {
       localSmileyGrid.release();
     }
     i += 1;
     break label20;
     break;
   }
 }
 @Override
 public int getSectionForPosition(int position) {
   for (int i = 0; i < mSections.size(); i++) {
     if (position > mSections.keyAt(i)) return i;
   }
   return mSections.size() - 1; // default to last section
 }
Пример #14
0
 public final void aRR() {
   SparseArray localSparseArray = joG.iJf;
   int i = 0;
   while (i < localSparseArray.size()) {
     int j = localSparseArray.keyAt(i);
     if ((localSparseArray.get(j) != null)
         && (((View) localSparseArray.get(j)).getTag() != null)) {
       dk localdk = (dk) ((View) localSparseArray.get(j)).getTag();
       if ((jsV != null) && (aSejsV.getVisibility() == 0)) {
         aSejsW.setVideoCallback(null);
         if ((((View) aSejsW).getVisibility() == 0) && (localdk != null)) {
           a(localdk, false);
           if (aSejsW != null) {
             aSejsW.stop();
           }
           com.tencent.mm.sdk.platformtools.t.d(
               "!56@/B4Tb64lLpJSmuQVFTi9B9WC1kKvsIMG1JrAubS9srFt8FIKKlOCYA==",
               "mAudioHelperTool abandonFocus");
           bco.aD(false);
         }
       }
     }
     i += 1;
   }
 }
Пример #15
0
  @Override
  protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);

    // Canvas background color depends on whether there is an active touch
    if (mHasTouch) {
      canvas.drawColor(BACKGROUND_ACTIVE);
    } else {
      // draw inactive border
      canvas.drawRect(
          mBorderWidth,
          mBorderWidth,
          getWidth() - mBorderWidth,
          getHeight() - mBorderWidth,
          mBorderPaint);
    }

    // loop through all active touches and draw them
    for (int i = 0; i < mTouches.size(); i++) {

      // get the pointer id and associated data for this index
      int id = mTouches.keyAt(i);
      TouchHistory data = mTouches.valueAt(i);

      // draw the data and its history to the canvas
      drawCircle(canvas, id, data);
    }
  }
 void resetProcessCrashTimeLocked(boolean resetEntireUser, int appId, int userId) {
   final ArrayMap<String, SparseArray<Long>> pmap = mProcessCrashTimes.getMap();
   for (int ip = pmap.size() - 1; ip >= 0; ip--) {
     SparseArray<Long> ba = pmap.valueAt(ip);
     for (int i = ba.size() - 1; i >= 0; i--) {
       boolean remove = false;
       final int entUid = ba.keyAt(i);
       if (!resetEntireUser) {
         if (userId == UserHandle.USER_ALL) {
           if (UserHandle.getAppId(entUid) == appId) {
             remove = true;
           }
         } else {
           if (entUid == UserHandle.getUid(userId, appId)) {
             remove = true;
           }
         }
       } else if (UserHandle.getUserId(entUid) == userId) {
         remove = true;
       }
       if (remove) {
         ba.removeAt(i);
       }
     }
     if (ba.size() == 0) {
       pmap.removeAt(ip);
     }
   }
 }
Пример #17
0
 public void removeAllPops() {
   int size = popupWindows.size();
   for (int i = 0; i < size; i++) {
     int key = popupWindows.keyAt(i);
     removePop(key);
   }
 }
Пример #18
0
 public static void clearViewHolder() {
   for (int i = 0; i < viewHolder.size(); i++) {
     View view = viewHolder.get(viewHolder.keyAt(i));
     if (view instanceof TextView) {
       ((TextView) view).setText("");
     }
   }
 }
Пример #19
0
 public static void stopLoops() {
   if (sLoopRunnerMap.size() > 0) {
     for (int i = 0; i < sLoopRunnerMap.size(); i++) {
       int key = sLoopRunnerMap.keyAt(i);
       stopLoop(key);
     }
   }
 }
 @Override
 public int[] getSelectedIndices() {
   int[] selection = new int[selectedItems.size()];
   for (int i = 0; i < selectedItems.size(); ++i) {
     selection[i] = selectedItems.keyAt(i);
   }
   return selection;
 }
 private int keyOfFirstMatchingStateSet(int[] stateSet) {
   int length = mStateSets.size();
   for (int i = 0; i < length; i++) {
     if (StateSet.stateSetMatches(mStateSets.valueAt(i), stateSet)) {
       return mStateSets.keyAt(i);
     }
   }
   return -1;
 }
Пример #22
0
 private final List<Integer> getSelectedIds() {
   ArrayList<Integer> selectedIds = new ArrayList<Integer>();
   for (int index = 0; index < mSelectState.size(); index++) {
     if (mSelectState.valueAt(index)) {
       selectedIds.add(mSelectState.keyAt(index));
     }
   }
   return selectedIds;
 }
 @Override
 public int getPositionForSection(int sectionIndex) {
   int index;
   if (mSections.size() == 0) index = 0;
   else if (sectionIndex >= mSections.size()) index = mSections.size() - 1;
   else if (sectionIndex <= 0) index = 0;
   else index = sectionIndex;
   return mSections.keyAt(index);
 }
 private int keyOfStateSet(int[] stateSet) {
   int length = mStateSets.size();
   for (int i = 0; i < length; i++) {
     if (mStateSets.valueAt(i).equals(stateSet)) {
       return mStateSets.keyAt(i);
     }
   }
   return -1;
 }
Пример #25
0
  public Throwable fhir(SparseArray<GlucoseRecord> records) {

    try {
      Patient p = getPatient();
      Log.d(TAG, "converting glucoserecrods to observations now");

      Device d = initializeDevice(p);
      // do conditional update here so the device is updated if needed

      String ident = getConditionalUrl(d, d.getIdentifierFirstRep());
      String a = ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(d);
      IdDt id = (IdDt) client.update().resource(d).conditionalByUrl(ident).execute().getId();
      d.setId(id);

      DeviceMetric metric = initializeDeviceMetric(d);
      metric.setId(
          client
              .create()
              .resource(metric)
              .conditionalByUrl(getConditionalUrl(metric, metric.getIdentifier()))
              .execute()
              .getId());

      for (int i = 0; i < records.size(); i++) {
        int j = records.keyAt(i);
        GlucoseRecord r = records.get(j);

        Log.d(TAG, "creating quantity");

        QuantityDt qdt = initializeQuantityDt(r);

        Observation o = initializeObservation(p, metric, r, qdt);

        Log.d(TAG, "submitting to server...");
        // client.update().resource(o).conditionalByUrl("Observation?identifier=http://...%7Cid").encodedJson().execute();
        IdDt did =
            (IdDt)
                client
                    .update()
                    .resource(o)
                    .conditionalByUrl(getConditionalUrl(o, o.getIdentifierFirstRep()))
                    .execute()
                    .getId();

        o.setId(did);

        String s = ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(o);

        Log.d(TAG, "... done");
      }
    } catch (Throwable e) {
      return e;
    }

    return null;
  }
  public static int getCategory(String categoryName) {
    int size = s_categoryMap.size();
    for (int ix = 0; ix < size; ++ix) {
      if (categoryName.equals(s_categoryMap.valueAt(ix))) {
        return s_categoryMap.keyAt(ix);
      }
    }

    return CATEGORY_INVALID;
  }
 public int[] getCurrentProfileIds() {
   synchronized (mCurrentProfiles) {
     int[] users = new int[mCurrentProfiles.size()];
     final int N = mCurrentProfiles.size();
     for (int i = 0; i < N; ++i) {
       users[i] = mCurrentProfiles.keyAt(i);
     }
     return users;
   }
 }
  @Override // Binder call
  public void dump(FileDescriptor fd, final PrintWriter pw, String[] args) {
    if (mContext == null
        || mContext.checkCallingOrSelfPermission(Manifest.permission.DUMP)
            != PackageManager.PERMISSION_GRANTED) {
      pw.println(
          "Permission Denial: can't dump DisplayManager from from pid="
              + Binder.getCallingPid()
              + ", uid="
              + Binder.getCallingUid());
      return;
    }

    pw.println("DISPLAY MANAGER (dumpsys display)");

    synchronized (mSyncRoot) {
      pw.println("  mHeadless=" + mHeadless);
      pw.println("  mOnlyCode=" + mOnlyCore);
      pw.println("  mSafeMode=" + mSafeMode);
      pw.println("  mPendingTraversal=" + mPendingTraversal);
      pw.println(
          "  mAllDisplayBlankStateFromPowerManager=" + mAllDisplayBlankStateFromPowerManager);
      pw.println("  mNextNonDefaultDisplayId=" + mNextNonDefaultDisplayId);
      pw.println("  mDefaultViewport=" + mDefaultViewport);
      pw.println("  mExternalTouchViewport=" + mExternalTouchViewport);
      pw.println("  mSingleDisplayDemoMode=" + mSingleDisplayDemoMode);

      IndentingPrintWriter ipw = new IndentingPrintWriter(pw, "    ");
      ipw.increaseIndent();

      pw.println();
      pw.println("Display Adapters: size=" + mDisplayAdapters.size());
      for (DisplayAdapter adapter : mDisplayAdapters) {
        pw.println("  " + adapter.getName());
        adapter.dumpLocked(ipw);
      }

      pw.println();
      pw.println("Display Devices: size=" + mDisplayDevices.size());
      for (DisplayDevice device : mDisplayDevices) {
        pw.println("  " + device.getDisplayDeviceInfoLocked());
        device.dumpLocked(ipw);
      }

      final int logicalDisplayCount = mLogicalDisplays.size();
      pw.println();
      pw.println("Logical Displays: size=" + logicalDisplayCount);
      for (int i = 0; i < logicalDisplayCount; i++) {
        int displayId = mLogicalDisplays.keyAt(i);
        LogicalDisplay display = mLogicalDisplays.valueAt(i);
        pw.println("  Display " + displayId + ":");
        display.dumpLocked(ipw);
      }
    }
  }
Пример #29
0
 static View retrieveFromScrap(SparseArray<View> scrapViews, int position) {
   int size = scrapViews.size();
   if (size > 0) {
     // See if we still have a view for this position.
     for (int i = 0; i < size; i++) {
       int fromPosition = scrapViews.keyAt(i);
       View view = scrapViews.get(fromPosition);
       if (fromPosition == position) {
         scrapViews.remove(fromPosition);
         return view;
       }
     }
     int index = size - 1;
     View r = scrapViews.valueAt(index);
     scrapViews.remove(scrapViews.keyAt(index));
     return r;
   } else {
     return null;
   }
 }
Пример #30
0
  public String findRenderIdByViewId(int view_id) {

    for (int i = 0; i < _renders.size(); i++) {
      int key = _renders.keyAt(i);
      if (key == view_id) {
        RenderViewData data = _renders.valueAt(i);
        return data._user;
      }
    }
    return null;
  }