/development/samples/DataWiper/src/com.example.android.datawiper/ |
D | MyAdmin.java | 26 public static ComponentName getComponent(Context context) { in getComponent() argument 27 return new ComponentName(context, MyAdmin.class); in getComponent() 30 public static boolean isEnabled(Context context) { in isEnabled() argument 31 return ((DevicePolicyManager) (context.getSystemService(Context.DEVICE_POLICY_SERVICE))) in isEnabled() 32 .isAdminActive(getComponent(context)); in isEnabled() 35 public static void disable(Context context) { in disable() argument 36 ((DevicePolicyManager) (context.getSystemService(Context.DEVICE_POLICY_SERVICE))) in disable() 37 .removeActiveAdmin(getComponent(context)); in disable() 41 public void onEnabled(Context context, Intent intent) { in onEnabled() argument 42 MyMain.restart(context); in onEnabled() [all …]
|
/development/samples/browseable/Notifications/Wearable/src/com.example.android.support.wearable.notifications/ |
D | NotificationPresets.java | 53 private static Notification.Builder buildBasicNotification(Context context) { in buildBasicNotification() argument 54 return new Notification.Builder(context) in buildBasicNotification() 55 .setContentTitle(context.getString(R.string.example_content_title)) in buildBasicNotification() 56 .setContentText(context.getString(R.string.example_content_text)) in buildBasicNotification() 58 .setContentIntent(PendingIntent.getActivity(context, 0, in buildBasicNotification() 59 new Intent(context, MainActivity.class), 0)) in buildBasicNotification() 69 public Notification buildNotification(Context context) { in buildNotification() argument 70 PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, in buildNotification() 71 new Intent(context, MainActivity.class), 0); in buildNotification() 73 Notification page2 = buildBasicNotification(context) in buildNotification() [all …]
|
/development/samples/browseable/Notifications/Application/src/com.example.android.support.wearable.notifications/ |
D | NotificationPresets.java | 70 private static NotificationCompat.Builder applyBasicOptions(Context context, in applyBasicOptions() argument 77 context, R.string.example_notification_deleted)); in applyBasicOptions() 78 options.actionsPreset.apply(context, builder, wearableOptions); in applyBasicOptions() 82 context.getResources(), R.drawable.example_large_icon)); in applyBasicOptions() 88 builder.setContentIntent(NotificationUtil.getExamplePendingIntent(context, in applyBasicOptions() 104 public Notification[] buildNotifications(Context context, BuildOptions options) { in buildNotifications() argument 105 NotificationCompat.Builder builder = new NotificationCompat.Builder(context); in buildNotifications() 108 applyBasicOptions(context, builder, wearableOptions, options); in buildNotifications() 121 public Notification[] buildNotifications(Context context, BuildOptions options) { in buildNotifications() argument 158 NotificationCompat.Builder builder = new NotificationCompat.Builder(context) in buildNotifications() [all …]
|
D | ActionsPresets.java | 45 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument 56 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument 59 context.getString(R.string.example_action), in apply() 60 NotificationUtil.getExamplePendingIntent(context, in apply() 72 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument 75 context.getString(R.string.example_action_long_title), in apply() 76 NotificationUtil.getExamplePendingIntent(context, in apply() 88 public void apply(Context context, NotificationCompat.Builder builder, in apply() argument 91 .setLabel(context.getString(R.string.example_reply_label)) in apply() 95 context.getString(R.string.example_reply_action), in apply() [all …]
|
/development/samples/devbytes/telephony/SmsSampleProject/app/src/main/java/com/example/android/smssample/receiver/ |
D | MessagingReceiver.java | 35 public void onReceive(Context context, Intent intent) { in onReceive() argument 39 if (Utils.hasKitKat() && Utils.isDefaultSmsApp(context)) { in onReceive() 41 handleIncomingSms(context, intent); in onReceive() 43 handleIncomingMms(context, intent); in onReceive() 47 handleIncomingSms(context, intent); in onReceive() 49 handleIncomingMms(context, intent); in onReceive() 54 private void handleIncomingSms(Context context, Intent intent) { in handleIncomingSms() argument 58 intent.setClass(context, MessagingService.class); in handleIncomingSms() 59 startWakefulService(context, intent); in handleIncomingSms() 62 private void handleIncomingMms(Context context, Intent intent) { in handleIncomingMms() argument [all …]
|
/development/samples/StackWidget/src/com/example/android/stackwidget/ |
D | StackWidgetProvider.java | 33 public void onDeleted(Context context, int[] appWidgetIds) { in onDeleted() argument 34 super.onDeleted(context, appWidgetIds); in onDeleted() 38 public void onDisabled(Context context) { in onDisabled() argument 39 super.onDisabled(context); in onDisabled() 43 public void onEnabled(Context context) { in onEnabled() argument 44 super.onEnabled(context); in onEnabled() 48 public void onReceive(Context context, Intent intent) { in onReceive() argument 49 AppWidgetManager mgr = AppWidgetManager.getInstance(context); in onReceive() 54 Toast.makeText(context, "Touched view " + viewIndex, Toast.LENGTH_SHORT).show(); in onReceive() 56 super.onReceive(context, intent); in onReceive() [all …]
|
/development/samples/browseable/DeviceOwner/src/com.example.android.deviceowner/ |
D | DeviceOwnerReceiver.java | 36 public void onProfileProvisioningComplete(Context context, Intent intent) { in onProfileProvisioningComplete() argument 39 (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE); in onProfileProvisioningComplete() 40 ComponentName componentName = getComponentName(context); in onProfileProvisioningComplete() 41 manager.setProfileName(componentName, context.getString(R.string.profile_name)); in onProfileProvisioningComplete() 43 Intent launch = new Intent(context, MainActivity.class); in onProfileProvisioningComplete() 45 context.startActivity(launch); in onProfileProvisioningComplete() 52 public static ComponentName getComponentName(Context context) { in getComponentName() argument 53 return new ComponentName(context.getApplicationContext(), DeviceOwnerReceiver.class); in getComponentName()
|
/development/samples/ApiDemos/src/com/example/android/apis/appwidget/ |
D | ExampleAppWidgetProvider.java | 52 public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { in onUpdate() argument 61 String titlePrefix = ExampleAppWidgetConfigure.loadTitlePref(context, appWidgetId); in onUpdate() 62 updateAppWidget(context, appWidgetManager, appWidgetId, titlePrefix); in onUpdate() 67 public void onDeleted(Context context, int[] appWidgetIds) { in onDeleted() argument 72 ExampleAppWidgetConfigure.deleteTitlePref(context, appWidgetIds[i]); in onDeleted() 77 public void onEnabled(Context context) { in onEnabled() argument 83 PackageManager pm = context.getPackageManager(); in onEnabled() 91 public void onDisabled(Context context) { in onDisabled() argument 95 PackageManager pm = context.getPackageManager(); in onDisabled() 102 static void updateAppWidget(Context context, AppWidgetManager appWidgetManager, in updateAppWidget() argument [all …]
|
D | ExampleAppWidgetConfigure.java | 86 final Context context = ExampleAppWidgetConfigure.this; 91 saveTitlePref(context, mAppWidgetId, titlePrefix); 94 AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context); 95 ExampleAppWidgetProvider.updateAppWidget(context, appWidgetManager, 107 static void saveTitlePref(Context context, int appWidgetId, String text) { in saveTitlePref() argument 108 SharedPreferences.Editor prefs = context.getSharedPreferences(PREFS_NAME, 0).edit(); in saveTitlePref() 115 static String loadTitlePref(Context context, int appWidgetId) { in loadTitlePref() argument 116 SharedPreferences prefs = context.getSharedPreferences(PREFS_NAME, 0); in loadTitlePref() 121 return context.getString(R.string.appwidget_prefix_default); in loadTitlePref() 125 static void deleteTitlePref(Context context, int appWidgetId) { in deleteTitlePref() argument [all …]
|
/development/samples/ApiDemos/src/com/example/android/apis/view/ |
D | ResourcePointerIconButton.java | 29 public ResourcePointerIconButton(Context context) { in ResourcePointerIconButton() argument 30 this(context, null); in ResourcePointerIconButton() 33 public ResourcePointerIconButton(Context context, AttributeSet attrs) { in ResourcePointerIconButton() argument 34 super(context, attrs); in ResourcePointerIconButton() 37 public ResourcePointerIconButton(Context context, AttributeSet attrs, int defStyleAttr) { in ResourcePointerIconButton() argument 38 super(context, attrs, defStyleAttr); in ResourcePointerIconButton() 41 public ResourcePointerIconButton(Context context, AttributeSet attrs, in ResourcePointerIconButton() argument 43 super(context, attrs, defStyleAttr, defStyleRes); in ResourcePointerIconButton()
|
D | StaticPointerIconButton.java | 31 public StaticPointerIconButton(Context context) { in StaticPointerIconButton() argument 32 this(context, null); in StaticPointerIconButton() 35 public StaticPointerIconButton(Context context, AttributeSet attrs) { in StaticPointerIconButton() argument 36 super(context, attrs); in StaticPointerIconButton() 39 public StaticPointerIconButton(Context context, AttributeSet attrs, int defStyleAttr) { in StaticPointerIconButton() argument 40 super(context, attrs, defStyleAttr); in StaticPointerIconButton() 43 public StaticPointerIconButton(Context context, AttributeSet attrs, in StaticPointerIconButton() argument 45 super(context, attrs, defStyleAttr, defStyleRes); in StaticPointerIconButton()
|
D | SystemPointerIconButton.java | 27 public SystemPointerIconButton(Context context) { in SystemPointerIconButton() argument 28 this(context, null); in SystemPointerIconButton() 31 public SystemPointerIconButton(Context context, AttributeSet attrs) { in SystemPointerIconButton() argument 32 super(context, attrs); in SystemPointerIconButton() 35 public SystemPointerIconButton(Context context, AttributeSet attrs, int defStyleAttr) { in SystemPointerIconButton() argument 36 super(context, attrs, defStyleAttr); in SystemPointerIconButton() 39 public SystemPointerIconButton(Context context, AttributeSet attrs, in SystemPointerIconButton() argument 41 super(context, attrs, defStyleAttr, defStyleRes); in SystemPointerIconButton()
|
/development/samples/browseable/MessagingService/src/com.example.android.messagingservice/ |
D | MessageLogger.java | 39 public static void logMessage(Context context, String message) { in logMessage() argument 40 SharedPreferences prefs = getPrefs(context); in logMessage() 47 public static SharedPreferences getPrefs(Context context) { in getPrefs() argument 48 return context.getSharedPreferences(PREF_MESSAGE, Context.MODE_PRIVATE); in getPrefs() 51 public static String getAllMessages(Context context) { in getAllMessages() argument 52 return getPrefs(context).getString(LOG_KEY, ""); in getAllMessages() 55 public static void clear(Context context) { in clear() argument 56 getPrefs(context).edit().remove(LOG_KEY).apply(); in clear()
|
/development/samples/RandomMusicPlayer/src/com/example/android/musicplayer/ |
D | MusicIntentReceiver.java | 34 public void onReceive(Context context, Intent intent) { in onReceive() argument 36 Toast.makeText(context, "Headphones disconnected.", Toast.LENGTH_SHORT).show(); in onReceive() 39 context.startService(new Intent(MusicService.ACTION_PAUSE)); in onReceive() 49 context.startService(new Intent(MusicService.ACTION_TOGGLE_PLAYBACK)); in onReceive() 52 context.startService(new Intent(MusicService.ACTION_PLAY)); in onReceive() 55 context.startService(new Intent(MusicService.ACTION_PAUSE)); in onReceive() 58 context.startService(new Intent(MusicService.ACTION_STOP)); in onReceive() 61 context.startService(new Intent(MusicService.ACTION_SKIP)); in onReceive() 66 context.startService(new Intent(MusicService.ACTION_REWIND)); in onReceive()
|
/development/samples/browseable/ActivitySceneTransitionBasic/src/com.example.android.activityscenetransitionbasic/ |
D | SquareFrameLayout.java | 28 public SquareFrameLayout(Context context) { in SquareFrameLayout() argument 29 super(context); in SquareFrameLayout() 32 public SquareFrameLayout(Context context, AttributeSet attrs) { in SquareFrameLayout() argument 33 super(context, attrs); in SquareFrameLayout() 36 public SquareFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) { in SquareFrameLayout() argument 37 super(context, attrs, defStyleAttr); in SquareFrameLayout() 40 public SquareFrameLayout(Context context, AttributeSet attrs, in SquareFrameLayout() argument 42 super(context, attrs, defStyleAttr, defStyleRes); in SquareFrameLayout()
|
/development/samples/browseable/AsymmetricFingerprintDialog/src/com.example.android.asymmetricfingerprintdialog/ |
D | FingerprintModule.java | 51 public FingerprintModule(Context context) { in FingerprintModule() argument 52 mContext = context; in FingerprintModule() 61 public FingerprintManager providesFingerprintManager(Context context) { in providesFingerprintManager() argument 62 return context.getSystemService(FingerprintManager.class); in providesFingerprintManager() 66 public KeyguardManager providesKeyguardManager(Context context) { in providesKeyguardManager() argument 67 return context.getSystemService(KeyguardManager.class); in providesKeyguardManager() 98 public InputMethodManager providesInputMethodManager(Context context) { in providesInputMethodManager() argument 99 return (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); in providesInputMethodManager() 103 public SharedPreferences providesSharedPreferences(Context context) { in providesSharedPreferences() argument 104 return PreferenceManager.getDefaultSharedPreferences(context); in providesSharedPreferences()
|
/development/samples/WeatherListWidget/src/com/example/android/weatherlistwidget/ |
D | WeatherWidgetProvider.java | 88 public void onEnabled(Context context) { in onEnabled() argument 93 final ContentResolver r = context.getContentResolver(); in onEnabled() 95 final AppWidgetManager mgr = AppWidgetManager.getInstance(context); in onEnabled() 96 final ComponentName cn = new ComponentName(context, WeatherWidgetProvider.class); in onEnabled() 110 final Context context = ctx; in onReceive() local 115 final ContentResolver r = context.getContentResolver(); in onReceive() 132 final AppWidgetManager mgr = AppWidgetManager.getInstance(context); in onReceive() 133 … final ComponentName cn = new ComponentName(context, WeatherWidgetProvider.class); in onReceive() 152 private RemoteViews buildLayout(Context context, int appWidgetId, boolean largeLayout) { in buildLayout() argument 157 final Intent intent = new Intent(context, WeatherWidgetService.class); in buildLayout() [all …]
|
/development/tools/checkcolor/src/main/java/com/google/checkcolor/lint/ |
D | HardcodedColorDetector.java | 115 public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) { in visitAttribute() argument 116 if (!LintUtils.isEnglishResource(context, true)) { in visitAttribute() 125 if (context.isEnabled(ISSUE)) { in visitAttribute() 126 context.report(ISSUE, attribute, context.getLocation(attribute), in visitAttribute() 130 addIndirectColor(context, value, attribute); in visitAttribute() 135 public void visitElement(@NonNull XmlContext context, @NonNull Element element) { in visitElement() argument 136 if (context.getResourceFolderType() != ResourceFolderType.VALUES) { in visitElement() 140 if (!LintUtils.isEnglishResource(context, true)) { in visitElement() 144 final int phase = context.getPhase(); in visitElement() 162 context.report(ISSUE, childElement, context.getLocation(child), in visitElement() [all …]
|
/development/samples/devbytes/telephony/SmsSampleProject/app/src/main/java/com/example/android/smssample/ |
D | Utils.java | 47 public static boolean isDefaultSmsApp(Context context) { in isDefaultSmsApp() argument 49 return context.getPackageName().equals(Telephony.Sms.getDefaultSmsPackage(context)); in isDefaultSmsApp() 60 public static void setDefaultSmsApp(Context context) { in setDefaultSmsApp() argument 64 intent.putExtra(Intents.EXTRA_PACKAGE_NAME, context.getPackageName()); in setDefaultSmsApp() 65 context.startActivity(intent); in setDefaultSmsApp()
|
/development/samples/browseable/JumpingJack/src/com.example.android.wearable.jumpingjack/ |
D | Utils.java | 36 public final static void vibrate(Context context, int duration) { in vibrate() argument 40 Vibrator v = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); in vibrate() 48 public static void saveCounterToPreference(Context context, int value) { in saveCounterToPreference() argument 49 SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context); in saveCounterToPreference() 62 public static int getCounterFromPreference(Context context) { in getCounterFromPreference() argument 63 SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context); in getCounterFromPreference()
|
/development/samples/CrossCompatibility/src/com/example/android/touchexample/ |
D | TouchExampleView.java | 33 public TouchExampleView(Context context) { in TouchExampleView() argument 34 this(context, null, 0); in TouchExampleView() 37 public TouchExampleView(Context context, AttributeSet attrs) { in TouchExampleView() argument 38 this(context, attrs, 0); in TouchExampleView() 41 public TouchExampleView(Context context, AttributeSet attrs, int defStyle) { in TouchExampleView() argument 42 super(context, attrs, defStyle); in TouchExampleView() 43 mIcon = context.getResources().getDrawable(R.drawable.icon); in TouchExampleView() 46 mDetector = VersionedGestureDetector.newInstance(context, new GestureCallback()); in TouchExampleView()
|
/development/samples/browseable/AppRestrictionEnforcer/src/com.example.android.apprestrictionenforcer/ |
D | EnforcerDeviceAdminReceiver.java | 36 public void onProfileProvisioningComplete(Context context, Intent intent) { in onProfileProvisioningComplete() argument 38 Intent launch = new Intent(context, EnableProfileActivity.class); in onProfileProvisioningComplete() 40 context.startActivity(launch); in onProfileProvisioningComplete() 47 public static ComponentName getComponentName(Context context) { in getComponentName() argument 48 return new ComponentName(context.getApplicationContext(), in getComponentName()
|
/development/samples/browseable/BasicManagedProfile/src/com.example.android.basicmanagedprofile/ |
D | BasicDeviceAdminReceiver.java | 36 public void onProfileProvisioningComplete(Context context, Intent intent) { in onProfileProvisioningComplete() argument 38 Intent launch = new Intent(context, EnableProfileActivity.class); in onProfileProvisioningComplete() 40 context.startActivity(launch); in onProfileProvisioningComplete() 47 public static ComponentName getComponentName(Context context) { in getComponentName() argument 48 return new ComponentName(context.getApplicationContext(), BasicDeviceAdminReceiver.class); in getComponentName()
|
/development/samples/SoftKeyboard/src/com/android/inputmethodcommon/ |
D | InputMethodSettingsImpl.java | 57 public boolean init(final Context context, final PreferenceScreen prefScreen) { in init() argument 58 mContext = context; in init() 59 mImm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); in init() 60 mImi = getMyImi(context, mImm); in init() 64 mSubtypeEnablerPreference = new Preference(context); in init() 69 final CharSequence title = getSubtypeEnablerTitle(context); in init() 79 context.startActivity(intent); in init() 88 private static InputMethodInfo getMyImi(Context context, InputMethodManager imm) { in getMyImi() argument 92 if (imis.get(i).getPackageName().equals(context.getPackageName())) { in getMyImi() 100 Context context, InputMethodManager imm, InputMethodInfo imi) { in getEnabledSubtypesLabel() argument [all …]
|
/development/samples/ApiDemos/src/com/example/android/apis/text/ |
D | LogTextBox.java | 38 public LogTextBox(Context context) { in LogTextBox() argument 39 this(context, null); in LogTextBox() 42 public LogTextBox(Context context, AttributeSet attrs) { in LogTextBox() argument 43 this(context, attrs, android.R.attr.textViewStyle); in LogTextBox() 46 public LogTextBox(Context context, AttributeSet attrs, int defStyle) { in LogTextBox() argument 47 super(context, attrs, defStyle); in LogTextBox()
|