コード例 #1
0
 void init() {
   try {
     mInstallLocation = mPm.getInstallLocation();
   } catch (RemoteException e) {
     Log.e("CanBeOnSdCardChecker", "Is Package Manager running?");
     return;
   }
 }
コード例 #2
0
 private void runGetInstallLocation() {
   try {
     int loc = mPm.getInstallLocation();
     String locStr = "invalid";
     if (loc == PackageHelper.APP_INSTALL_AUTO) {
       locStr = "auto";
     } else if (loc == PackageHelper.APP_INSTALL_INTERNAL) {
       locStr = "internal";
     } else if (loc == PackageHelper.APP_INSTALL_EXTERNAL) {
       locStr = "external";
     }
     System.out.println(loc + "[" + locStr + "]");
   } catch (RemoteException e) {
     System.err.println(e.toString());
     System.err.println(PM_NOT_RUNNING_ERR);
   }
 }