Search in sources :

Example 1 with DevicePolicyManagerWrapperImpl

use of com.android.settings.enterprise.DevicePolicyManagerWrapperImpl in project android_packages_apps_Settings by LineageOS.

the class AppInfoBase method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mFinishing = false;
    final Activity activity = getActivity();
    mApplicationFeatureProvider = FeatureFactory.getFactory(activity).getApplicationFeatureProvider(activity);
    mState = ApplicationsState.getInstance(activity.getApplication());
    mSession = mState.newSession(this);
    mDpm = new DevicePolicyManagerWrapperImpl((DevicePolicyManager) activity.getSystemService(Context.DEVICE_POLICY_SERVICE));
    mUserManager = (UserManager) activity.getSystemService(Context.USER_SERVICE);
    mPm = activity.getPackageManager();
    IBinder b = ServiceManager.getService(Context.USB_SERVICE);
    mUsbManager = IUsbManager.Stub.asInterface(b);
    retrieveAppEntry();
    startListeningToPackageRemove();
}
Also used : DevicePolicyManager(android.app.admin.DevicePolicyManager) DevicePolicyManagerWrapperImpl(com.android.settings.enterprise.DevicePolicyManagerWrapperImpl) IBinder(android.os.IBinder) SettingsActivity(com.android.settings.SettingsActivity) Activity(android.app.Activity)

Example 2 with DevicePolicyManagerWrapperImpl

use of com.android.settings.enterprise.DevicePolicyManagerWrapperImpl in project android_packages_apps_Settings by LineageOS.

the class AdvancedPowerUsageDetail method onAttach.

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    mState = ApplicationsState.getInstance(getActivity().getApplication());
    mDpm = new DevicePolicyManagerWrapperImpl((DevicePolicyManager) activity.getSystemService(Context.DEVICE_POLICY_SERVICE));
    mUserManager = (UserManager) activity.getSystemService(Context.USER_SERVICE);
    mPackageManager = activity.getPackageManager();
    mBatteryUtils = BatteryUtils.getInstance(getContext());
}
Also used : DevicePolicyManager(android.app.admin.DevicePolicyManager) DevicePolicyManagerWrapperImpl(com.android.settings.enterprise.DevicePolicyManagerWrapperImpl)

Example 3 with DevicePolicyManagerWrapperImpl

use of com.android.settings.enterprise.DevicePolicyManagerWrapperImpl in project android_packages_apps_Settings by crdroidandroid.

the class AdvancedPowerUsageDetail method onAttach.

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    mState = ApplicationsState.getInstance(getActivity().getApplication());
    mDpm = new DevicePolicyManagerWrapperImpl((DevicePolicyManager) activity.getSystemService(Context.DEVICE_POLICY_SERVICE));
    mUserManager = (UserManager) activity.getSystemService(Context.USER_SERVICE);
    mPackageManager = activity.getPackageManager();
    mBatteryUtils = BatteryUtils.getInstance(getContext());
}
Also used : DevicePolicyManager(android.app.admin.DevicePolicyManager) DevicePolicyManagerWrapperImpl(com.android.settings.enterprise.DevicePolicyManagerWrapperImpl)

Example 4 with DevicePolicyManagerWrapperImpl

use of com.android.settings.enterprise.DevicePolicyManagerWrapperImpl in project android_packages_apps_Settings by SudaMod.

the class AppInfoBase method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mFinishing = false;
    final Activity activity = getActivity();
    mApplicationFeatureProvider = FeatureFactory.getFactory(activity).getApplicationFeatureProvider(activity);
    mState = ApplicationsState.getInstance(activity.getApplication());
    mSession = mState.newSession(this);
    mDpm = new DevicePolicyManagerWrapperImpl((DevicePolicyManager) activity.getSystemService(Context.DEVICE_POLICY_SERVICE));
    mUserManager = (UserManager) activity.getSystemService(Context.USER_SERVICE);
    mPm = activity.getPackageManager();
    IBinder b = ServiceManager.getService(Context.USB_SERVICE);
    mUsbManager = IUsbManager.Stub.asInterface(b);
    retrieveAppEntry();
    startListeningToPackageRemove();
}
Also used : DevicePolicyManager(android.app.admin.DevicePolicyManager) DevicePolicyManagerWrapperImpl(com.android.settings.enterprise.DevicePolicyManagerWrapperImpl) IBinder(android.os.IBinder) SettingsActivity(com.android.settings.SettingsActivity) Activity(android.app.Activity)

Example 5 with DevicePolicyManagerWrapperImpl

use of com.android.settings.enterprise.DevicePolicyManagerWrapperImpl in project android_packages_apps_Settings by DirtyUnicorns.

the class AdvancedPowerUsageDetail method onAttach.

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    mState = ApplicationsState.getInstance(getActivity().getApplication());
    mDpm = new DevicePolicyManagerWrapperImpl((DevicePolicyManager) activity.getSystemService(Context.DEVICE_POLICY_SERVICE));
    mUserManager = (UserManager) activity.getSystemService(Context.USER_SERVICE);
    mPackageManager = activity.getPackageManager();
    mBatteryUtils = BatteryUtils.getInstance(getContext());
}
Also used : DevicePolicyManager(android.app.admin.DevicePolicyManager) DevicePolicyManagerWrapperImpl(com.android.settings.enterprise.DevicePolicyManagerWrapperImpl)

Aggregations

DevicePolicyManager (android.app.admin.DevicePolicyManager)11 DevicePolicyManagerWrapperImpl (com.android.settings.enterprise.DevicePolicyManagerWrapperImpl)11 Activity (android.app.Activity)5 IBinder (android.os.IBinder)5 SettingsActivity (com.android.settings.SettingsActivity)5