android.os.RemoteException.rethrowFromSystemServer()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(265)

本文整理了Java中android.os.RemoteException.rethrowFromSystemServer方法的一些代码示例,展示了RemoteException.rethrowFromSystemServer的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RemoteException.rethrowFromSystemServer方法的具体详情如下:
包路径:android.os.RemoteException
类名称:RemoteException
方法名:rethrowFromSystemServer

RemoteException.rethrowFromSystemServer介绍

暂无

代码示例

代码示例来源:origin: robolectric/robolectric

@Implementation(maxSdk = JELLY_BEAN)
protected void getPackageSizeInfo(Object pkgName, Object observer) {
 final PackageStats packageStats = packageStatsMap.get((String) pkgName);
 new Handler(Looper.getMainLooper())
   .post(
     () -> {
      try {
       ((IPackageStatsObserver) observer)
         .onGetStatsCompleted(packageStats, packageStats != null);
      } catch (RemoteException remoteException) {
       remoteException.rethrowFromSystemServer();
      }
     });
}

代码示例来源:origin: robolectric/robolectric

@Implementation(minSdk = JELLY_BEAN_MR1, maxSdk = M)
protected void getPackageSizeInfo(Object pkgName, Object uid, final Object observer) {
 final PackageStats packageStats = packageStatsMap.get((String) pkgName);
 new Handler(Looper.getMainLooper())
   .post(
     () -> {
      try {
       ((IPackageStatsObserver) observer)
         .onGetStatsCompleted(packageStats, packageStats != null);
      } catch (RemoteException remoteException) {
       remoteException.rethrowFromSystemServer();
      }
     });
}

代码示例来源:origin: robolectric/robolectric

@Implementation(minSdk = N)
protected void getPackageSizeInfoAsUser(Object pkgName, Object uid, final Object observer) {
 final PackageStats packageStats = packageStatsMap.get((String) pkgName);
 new Handler(Looper.getMainLooper())
   .post(
     () -> {
      try {
       ((IPackageStatsObserver) observer)
         .onGetStatsCompleted(packageStats, packageStats != null);
      } catch (RemoteException remoteException) {
       remoteException.rethrowFromSystemServer();
      }
     });
}

代码示例来源:origin: stackoverflow.com

private static class StopInfo implements Runnable {
  ActivityClientRecord activity;
  Bundle state;
  PersistableBundle persistentState;
  CharSequence description;
  @Override public void run() {
    // Tell activity manager we have been stopped.
    try {
      if (DEBUG_MEMORY_TRIM) Slog.v(TAG, "Reporting activity stopped: " + activity);
      ActivityManagerNative.getDefault().activityStopped(
        activity.token, state, persistentState, description);
    } catch (RemoteException ex) {
      if (ex instanceof TransactionTooLargeException
          && activity.packageInfo.getTargetSdkVersion() < Build.VERSION_CODES.N) {
        Log.e(TAG, "App sent too much data in instance state, so it was ignored", ex);
        return;
      }
      throw ex.rethrowFromSystemServer(); // <<-- exception thrown here
    }
  }
}

代码示例来源:origin: org.robolectric/framework

public void run() {
  try {
   callback.onGetStatsCompleted(packageStats, packageStats != null);
  } catch (RemoteException remoteException) {
   remoteException.rethrowFromSystemServer();
  }
 }
});

代码示例来源:origin: org.robolectric/framework

public void run() {
  try {
   observer.onGetStatsCompleted(packageStats, packageStats != null);
  } catch (RemoteException remoteException) {
   remoteException.rethrowFromSystemServer();
  }
 }
});

代码示例来源:origin: org.robolectric/framework

public void run() {
  try {
   callback.onGetStatsCompleted(packageStats, packageStats != null);
  } catch (RemoteException remoteException) {
   remoteException.rethrowFromSystemServer();
  }
 }
});

代码示例来源:origin: org.robolectric/shadows-framework

@Implementation(minSdk = N)
protected void getPackageSizeInfoAsUser(Object pkgName, Object uid, final Object observer) {
 final PackageStats packageStats = packageStatsMap.get((String) pkgName);
 new Handler(Looper.getMainLooper())
   .post(
     () -> {
      try {
       ((IPackageStatsObserver) observer)
         .onGetStatsCompleted(packageStats, packageStats != null);
      } catch (RemoteException remoteException) {
       remoteException.rethrowFromSystemServer();
      }
     });
}

代码示例来源:origin: org.robolectric/shadows-framework

@Implementation(minSdk = JELLY_BEAN_MR1, maxSdk = M)
protected void getPackageSizeInfo(Object pkgName, Object uid, final Object observer) {
 final PackageStats packageStats = packageStatsMap.get((String) pkgName);
 new Handler(Looper.getMainLooper())
   .post(
     () -> {
      try {
       ((IPackageStatsObserver) observer)
         .onGetStatsCompleted(packageStats, packageStats != null);
      } catch (RemoteException remoteException) {
       remoteException.rethrowFromSystemServer();
      }
     });
}

代码示例来源:origin: org.robolectric/shadows-framework

@Implementation(maxSdk = JELLY_BEAN)
protected void getPackageSizeInfo(Object pkgName, Object observer) {
 final PackageStats packageStats = packageStatsMap.get((String) pkgName);
 new Handler(Looper.getMainLooper())
   .post(
     () -> {
      try {
       ((IPackageStatsObserver) observer)
         .onGetStatsCompleted(packageStats, packageStats != null);
      } catch (RemoteException remoteException) {
       remoteException.rethrowFromSystemServer();
      }
     });
}

相关文章