tools/android/appstats.py
def __GetUserIdForProcessName(adb, process_name):
    """Returns the userId of the application associated by |pid| or None if
    not found."""
    try:
      process_name = process_name.split(':')[0]
      cmd = ['dumpsys', 'package', process_name]
      user_id_lines = adb.RunShellCommand(
          cmd, large_output=True, check_return=True)
      user_id_lines = Utils.FindLines(user_id_lines, 'userId=')

      if not user_id_lines:
        return None

      columns = re.split('\s+|=', user_id_lines[0].strip())

      if len(columns) >= 2:
        return columns[1]
    except device_errors.AdbShellCommandFailedError:
      pass
    return None
Returns the userId of the application associated by |pid| or None if
    not found.
Returns the userId of the application associated by |pid| or None if
not found.
Returns the userId of the application associated by |pid| or None if not found .
def __GetUserIdForProcessName(adb, process_name):
    try:
      process_name = process_name.split(':')[0]
      cmd = ['dumpsys', 'package', process_name]
      user_id_lines = adb.RunShellCommand(
          cmd, large_output=True, check_return=True)
      user_id_lines = Utils.FindLines(user_id_lines, 'userId=')
      if not user_id_lines:
        return None
      columns = re.split('\s+|=', user_id_lines[0].strip())
      if len(columns) >= 2:
        return columns[1]
    except device_errors.AdbShellCommandFailedError:
      pass
    return None
def __GetUserIdForProcessName ( adb , process_name ) : try : process_name = process_name . split ( ':' ) [ 0 ] cmd = [ 'dumpsys' , 'package' , process_name ] user_id_lines = adb . RunShellCommand ( cmd , large_output = True , check_return = True ) user_id_lines = Utils . FindLines ( user_id_lines , 'userId=' ) if not user_id_lines : return None columns = re . split ( '\s+|=' , user_id_lines [ 0 ] . strip ( ) ) if len ( columns ) >= 2 : return columns [ 1 ] except device_errors . AdbShellCommandFailedError : pass return None
Returns the userId of the application associated by |pid| or None if
not found.
Returns the userId of the application associated by |pid| or None if not found .
"""Returns the userId of the application associated by |pid| or None if
    not found."""
adb
process_name