Messaging: Fix a few android related things
* NotificationBuilder.addPerson(String) -> .addPerson(Person) * Wearableextenter.addPage deprecated without replacement * Html.fromHtml(String) -> .fromHtml(String, int) * Handlers need Loopers * Resource-IDs are not final by default (if-else instead of switch-case) * call super.onFinishInflate() in override of onFinishInflate() * Configuration.locale -> configuration.getLocales().get(0) * SimpleDateFormat needs localization as well * AudioAttributes instead of setAudioStreamType() * isDataEnabled() is a public method, no need for reflection anymore Change-Id: Icd830768b86edca3e0b44f1edc6c57facc9f731a
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,7 +22,6 @@ import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Environment;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.messaging.Factory;
|
||||
import com.android.messaging.R;
|
||||
@@ -39,7 +39,8 @@ public class FileUtil {
|
||||
private static synchronized File getNewFile(File directory, String extension,
|
||||
String fileNameFormat) throws IOException {
|
||||
final Date date = new Date(System.currentTimeMillis());
|
||||
final SimpleDateFormat dateFormat = new SimpleDateFormat(fileNameFormat);
|
||||
final SimpleDateFormat dateFormat = new SimpleDateFormat(fileNameFormat,
|
||||
Locale.getDefault(Locale.Category.FORMAT));
|
||||
final String numberedFileNameFormat = dateFormat.format(date) + "_%02d" + "." + extension;
|
||||
for (int i = 1; i <= 99; i++) { // Only save 99 of the same file name.
|
||||
final String newName = String.format(Locale.US, numberedFileNameFormat, i);
|
||||
|
||||
Reference in New Issue
Block a user