Loading src/java/com/android/internal/telephony/TelephonyComponentFactory.java +18 −7 Original line number Diff line number Diff line Loading @@ -24,6 +24,10 @@ import android.os.Handler; import android.os.IDeviceIdleController; import android.os.Looper; import android.os.ServiceManager; import android.system.ErrnoException; import android.system.Os; import android.system.OsConstants; import android.system.StructStatVfs; import android.telephony.Rlog; import com.android.internal.telephony.cdma.CdmaSubscriptionSourceManager; Loading Loading @@ -80,11 +84,18 @@ public class TelephonyComponentFactory { private void makeInjectedInstance() { if (isInjected()) { try { StructStatVfs vfs = Os.statvfs(mJarPath); if ((vfs.f_flag & OsConstants.ST_RDONLY) != 0) { PathClassLoader classLoader = new PathClassLoader(mJarPath, ClassLoader.getSystemClassLoader()); try { Class<?> cls = classLoader.loadClass(mPackageName); mInjectedInstance = (TelephonyComponentFactory) cls.newInstance(); } else { Rlog.w(TAG, "Injection jar is not protected"); } } catch (ErrnoException e) { Rlog.e(TAG, "failed file mount, " + e.getMessage()); } catch (ClassNotFoundException e) { Rlog.e(TAG, "failed: " + e.getMessage()); } catch (IllegalAccessException | InstantiationException e) { Loading Loading @@ -203,7 +214,7 @@ public class TelephonyComponentFactory { */ public void injectTheComponentFactory(XmlResourceParser parser) { if (mInjectedComponents != null) { Rlog.i(TAG, "Already injected."); Rlog.d(TAG, "Already injected."); return; } Loading @@ -211,8 +222,8 @@ public class TelephonyComponentFactory { mInjectedComponents = new InjectedComponents(); mInjectedComponents.parseXml(parser); mInjectedComponents.makeInjectedInstance(); Rlog.i(TAG, "Total components injected: " + mInjectedComponents.mComponentNames.size()); Rlog.d(TAG, "Total components injected: " + (mInjectedComponents.isInjected() ? mInjectedComponents.mComponentNames.size() : 0)); } } Loading Loading
src/java/com/android/internal/telephony/TelephonyComponentFactory.java +18 −7 Original line number Diff line number Diff line Loading @@ -24,6 +24,10 @@ import android.os.Handler; import android.os.IDeviceIdleController; import android.os.Looper; import android.os.ServiceManager; import android.system.ErrnoException; import android.system.Os; import android.system.OsConstants; import android.system.StructStatVfs; import android.telephony.Rlog; import com.android.internal.telephony.cdma.CdmaSubscriptionSourceManager; Loading Loading @@ -80,11 +84,18 @@ public class TelephonyComponentFactory { private void makeInjectedInstance() { if (isInjected()) { try { StructStatVfs vfs = Os.statvfs(mJarPath); if ((vfs.f_flag & OsConstants.ST_RDONLY) != 0) { PathClassLoader classLoader = new PathClassLoader(mJarPath, ClassLoader.getSystemClassLoader()); try { Class<?> cls = classLoader.loadClass(mPackageName); mInjectedInstance = (TelephonyComponentFactory) cls.newInstance(); } else { Rlog.w(TAG, "Injection jar is not protected"); } } catch (ErrnoException e) { Rlog.e(TAG, "failed file mount, " + e.getMessage()); } catch (ClassNotFoundException e) { Rlog.e(TAG, "failed: " + e.getMessage()); } catch (IllegalAccessException | InstantiationException e) { Loading Loading @@ -203,7 +214,7 @@ public class TelephonyComponentFactory { */ public void injectTheComponentFactory(XmlResourceParser parser) { if (mInjectedComponents != null) { Rlog.i(TAG, "Already injected."); Rlog.d(TAG, "Already injected."); return; } Loading @@ -211,8 +222,8 @@ public class TelephonyComponentFactory { mInjectedComponents = new InjectedComponents(); mInjectedComponents.parseXml(parser); mInjectedComponents.makeInjectedInstance(); Rlog.i(TAG, "Total components injected: " + mInjectedComponents.mComponentNames.size()); Rlog.d(TAG, "Total components injected: " + (mInjectedComponents.isInjected() ? mInjectedComponents.mComponentNames.size() : 0)); } } Loading